Не шарю в Go совсем, так что может выглядеть странно
package main
import (
"fmt"
"encoding/xml"
)
type Body struct {
XMLName xml.Name
Status string `xml:"methodResponse>responseData>status"`
}
type Envelope struct {
XMLName xml.Name
Body Body `xml:"Body"`
}
func main() {
var envelope Envelope
raw := []byte(`
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<SOAP-ENV:methodResponse>
<responseData>
<status>OK</status>
</responseData>
</SOAP-ENV:methodResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
`)
err := xml.Unmarshal(raw, &envelope)
if err != nil {
fmt.Printf("something wrong %s", err)
}
fmt.Printf("Status: %s", envelope.Body.Status)
}
OUT
Status: OK
Process finished with exit code 0