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

KDSOAP and incorrect headers in post request



  • Hi for all.
    I need communicate with SOAP server in my application.
    And I choice KDSOAP for this.
    But I get a lot of different errors ( error code 2 and 5).

    as simple:
    Server has method testRun().

    Correct header for request:

    Content-Type: text/xml; charset=utf-8
    Soapaction: "http://m_ex#MX:testRun"
    

    Correct request body

    <?xml version="1.0"   encoding="UTF-8"        ?>
    <SOAP-ENV:Envelope
        xmlns:ns0="http://m_ex"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
        <SOAP-ENV:Header/>
            <ns1:Body>
                <ns0:testRun/>
           </ns1:Body>
      </SOAP-ENV:Envelope>
    

    If I use kdsoap, I get this:
    Header:

    Content-Type: application/soap+xml;charset=utf-8;action=http:/m_ex#MX:testRun
    

    and body:

    <?xml  version="1.0"  encoding="UTF-8"  ?>
    <soap:Envelope
       xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
       xmlns:soap-enc="http://www.w3.org/2003/05/soap-encoding"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soap:Body>
             <n1:testRun   xmlns:n1="http://med_ex"/>
       </soap:Body>
     </soap:Envelope>
    

    Why differences in Content-Type, in body request?
    why no 'soapaction'?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    I'd recommend trying to contact the KDSOAP authors. They'll be the more knowledgeable about that matter.


Log in to reply