hooklift/gowsdl

Modify envelop & body

grey9z opened this issue · 1 comments

Hello i need modify Envelop and Body xmlns fields. I did't found how can i get it. Can i make pull request with this functional part? Or maybe i missed something and anyone can point me on the way how can i do that. Thanks. So what can i do i try to show in xml bellow:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:somenamespace="http://myurl">
    <soapenv:Body> 
        <somenamespace:currentMethod> 
        </somenamespace:currentMethod> 
    </soapenv:Body> 
</soapenv:Envelope>

Thank you

They way that I've seen this solved in the past is by explicitly setting the namespace in the xml annotation, in your case:

type CurrentMethod struct {
	XMLName xml.Name `xml:"http://myurl currentMethod"`
    ...
}

this will result in the following XML:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body> 
        <currentMethod xmlns="http://myurl"> 
			...
        </currentMethod> 
    </soapenv:Body> 
</soapenv:Envelope>

which should be semantically equivalent