Search code examples
c++xmlweb-serviceswsdlgsoap

Breaking changes in gsoap (updating version from 2.8.8 to 2.8.16)


I have a C++ client using gSoap. When it used 2.8.8 version of gSoap it worked well. After upgrade to 2.8.16 it stopped working. It seems the problem is the following: we are missing soap envelope. Old version sent:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="urn:attachmentSoapServer"><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<data here>
</SOAP-ENV:Body></SOAP-ENV:Envelope>

New version is sending only:

<data here>

How to add soap header like it was in old version?

The code is like this:

struct soap soap;    
soap_init(&soap);

soap_call_here(...);

Solution

  • Please check the wsdl2h warning messages and the generated .h interface file.

    To ensure SOAP transport, the generated .h file should have:

    //gsoap ns1 service transport: http://schemas.xmlsoap.org/soap/http
    

    and for each service operation we would expect something like:

    //gsoap ns1 service method-protocol:   method SOAP
    

    If the method-protocol is HTTP (or POST,GET,PUT) then REST without SOAP Envelope and without SOAP Body will be used.