I am new to golang and Soap and having trouble in parsing soap msg.
1.I have an Soap message
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Body>
<activationPack_completeResponse"http://tempuri.org/">
<activationPack_completeResult xsi:type="xsd:string">Active</activationPack_completeResult>
</activationPack_completeResponse>
</soap:Body>
</soap:Envelope>
Now how should i Unmarshal them in golang what should be my struct declaration for tag Soap Envelope.
I have some structure as below:
type MyRespEnvelope struct {
XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"`
Soap *Body
}
type Body struct {
XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Body"`
GetResponse *ActivationPack_CompleteResponse
}
type ActivationPack_CompleteResponse struct {
XMLName xml.Name `xml:"activationPack_completeResponse"`
Id string `xml:"xmlns,attr"`
MyVar string `xml:"activationPack_completeResult"`
}
But I am getting error as below:
error: expected element <Envelope> in name space http://schemas.xmlsoap.org/soap/envelope/ but have soap*stopped,reason="end-stepping-range",frame={addr="0x0000000000401211",func="main.UnmarshalFirstDitto",args=[{name="data",value="\"\
Notice: Undefined variable: area in /var/www/nusoap/dittotv.php on line 25\
\
Notice: Undefined variable: area in /var/www/nusoap/dittotv.php on line 27\
\
Notice: Undefined variable: area in /var/www/nu\"..."}],file="/media/winshare/Golang/WorkSpace/src/DittoTv/ditto.go",fullname="/media/winshare/Golang/WorkSpace/src/DittoTv/ditto.go",line="60"},thread-id="1",stopped-threads="all",core="0"
So someone please tell me how should i declare my structure so that i am able to parse the soap message.