Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

KDSoap soapAction can not be empty



  • Hello,

    I want to try out KDSoap-CodeGen. The Code-Generation works very well, but if I start to call methods via the generated classes , the SOAP-Webservice returns Fault code soap:Server: The given SOAPAction http://webservice/doLogin does not match an operation. Heres an excerpt of the wsdl file:

    ....
    <operation name="doLogin">
    <soap:operation soapAction=" " />
    <input>
    <soap:body use="literal" />
    </input>
    <output>
    <soap:body use="literal" />
    </output>
    </operation>
    ....

    It describes, that the http-Header soapAction should be empty, but if I look at the tcp-Streams the header is not empty. How can I achieve the emptiness of that header? The setHeader method of the KDSoapClientInterface did not do the trick. I could hack the wsdl-file, if I change soapAction="#blank#" to soapAction="#noblank#" (I tried that and it works;-) ), but thats not the way, I want achieve it.

    Maybe someone could help me!

    Thank you


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    I'd recommend contacting the KDAB folks about that matter, they are the more knowledgeable about it.



  • @SGaist
    Thank you! Ok I did that. I'll post the solution here, if it's solved!



  • The single-space as a soapAction in the WSDL file is rather strange and looks like a bug in that WSDL file. But I assume you have no control over it ;)

    http://www.w3.org/TR/wsdl#_soap:operation and http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528 don't have much to say about it, they just say the value of soapAction is a URI, and is mandatory when using HTTP.
    Maybe some wrong implementation rejects the empty string, so someone hacked around it by using a single space...

    http://www.ws-i.org/profiles/basicprofile-1.1-2004-08-24.html#SOAPAction_HTTP_Header says it must be quoted. It also says empty is fine ;)

    Anyhow, this is easy to change in the wsdl parser.
    Want to try applying this patch to kdwsdl2cpp/wsdl/soapbinding.cpp?
    http://kdab.com/~dfaure/2015/soapbinding.cpp.diff
    Let me know how it goes.

    Can you confirm that at least one other implementation of SOAP sends an empty SoapAction header, based on this WSDL file? I wouldn't want to commit this if it creates some incompatibility...



  • Thanks!
    I agree completely to your response.
    Your patch solves the problem. No I could not confirm it. Your commit wouldn't create incompatibilities.



  • OK, I pushed the fix.


Log in to reply