How to add xmlns="MyNamespace" to AuthSOAPHeader in gSOAP -


I am creating client applications to access the web service from a third party server.

This server WSDL:

  & lt; S: element name = "authSOAPHeader" type = "tns: authSOAPHeader" /> & Lt; S: complex type name = "AuthSOAPHeader" & gt; & Lt; S: Sequence & gt; & Lt; S: element minOccurs = "0" maxOccurs = "1" name = "user" type = "s: string" /> & Lt; S: element minOccurs = "0" maxOccurs = "1" name = "password" type = "s: string" /> & Lt; / S: Sequence & gt; & Lt; S: any specialty / & gt; & Lt; / S: complexType & gt;   

And these commands:

  wsdl2h -k -o svc.h. \ Svc.asmx.xml soapcpp2 -i -C \ Svc.h   

My GSOP-based client application is generating this XML:

  & lt; SOAP-ENV: Header & gt; & Lt; Ns1 also: AuthSOAPHeader & gt; & Lt; Users & gt; Users & lt; / User & gt; & Lt; Password & gt; Password & lt; / Password & gt; & Lt; / Ns1 also: AuthSOAPHeader & gt; & Lt; / SOAP-ENV: Header & gt;   

But my server only responds to:

  & lt; SOAP-ENV: Header & gt; & Lt; Ns1: AuthSOAPHeader xmlns = "Server.WebServices" & gt; & Lt; Users & gt; Users & lt; / User & gt; & Lt; Password & gt; Password & lt; / Password & gt; & Lt; / Ns1 also: AuthSOAPHeader & gt; & Lt; / SOAP-ENV: Header & gt;   

I am struggling to remove a way to add xmlns = "Server.WebServices" attribute to the authSOAPHeader tag. Is there a way to do this in GSOP? Thanks in advance!

I fixed this flag by adding it to soap initialization:

  SOAP_XML_DEFAULTNS    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -