Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing namespace directive #118

Open
IanAber opened this issue Mar 4, 2019 · 2 comments
Open

Missing namespace directive #118

IanAber opened this issue Mar 4, 2019 · 2 comments

Comments

@IanAber
Copy link

IanAber commented Mar 4, 2019

I used WSDL2GO to create a template from a WSDL for Ivanti Service Manager at https://portal.flycastpartners.com/HEAT/ServiceAPI/FRSHEATIntegration.asmx?WSDL.

The resulting calls failed because the parameters have no namespace and there is no default namespace directive in the envelope...

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="SaaS.Services" xmlns:tns="SaaS.Services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
SOAP-ENV:Body

User
Password
TenantId
Role

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Either prefixing each tag with ns: or adding ' xmlns="SaaS.Services"' to the envelope attributes solves the problem but I could no see how to get WSDL2GO to do this without altering the code. In the end I modified the Envelope struct definition and the doRoundTrip function in client.go to add the default namespace to the envelope attributes using the same namespace as the NSAttr attribute.

Am I missing something here?

@divY42
Copy link

divY42 commented Apr 18, 2019

I have the same issue and do not see an option on wsdl2go to produce a different result.

@swimbots
Copy link

The issue is that xmlns:ns is being added as the NSAttr.

Envelope has struct tag
NSAttr string xml:"xmlns:ns,attr"

Replacing it with
NSAttr string xml:"xmlns,attr"

Fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants