Menu

#1298 Cannot create soap 1.2 compatible requests.

v1.0 (example)
closed
nobody
None
5
2021-08-19
2021-08-06
Jeff Shanab
No

If I read the spec correctly and I am very unsure, but the consensus is that the HTTP action header is required for soap1.1 and was no longer required with soap1.2.

The stdsoap2.cpp code seems to actually check for version 2 and puts action and SOAPAction in http headers if version is 2. The genreated core allways sets the action from the wsdl if not explicitly set, but that is for the soap object and not the HTTP headers.

Discussion

  • Robert van Engelen

    Not required with SOAP 1.2 does not imply forbidden. Note that WS-Addressing requires SOAP action headers to reroute HTTP content to other endpoints.

     
  • Jeff Shanab

    Jeff Shanab - 2021-08-09

    Thankyou. I realize that I may of focused in on the wrong thing.
    I am trying to upgrade gSOAP and use digest auth and having a lot of issues with some newere cameras in either digest or wsse mode and comparing wiresharks that was the most glarring differenece.

    So a better question is how do I make the requests look like the ones the onvif device test tool (C#) is issuing that manufacturers are using for conformance.

    wsse :
    Request:

    POST /onvif/media_service HTTP/1.1
    Host: 172.19.235.162
    Content-Type: application/soap+xml; charset=utf-8
    Content-Length: 897

    <s:envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:header> <wsse:security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:usernametoken> <wsse:username>admin</wsse:username> <wsse:password type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">5T2oNUc8F8jaz8BnsRXNFUTqAMU=</wsse:password> <wsse:nonce>mko1w7tct+J1pLfVIL72bA==</wsse:nonce> <wsu:created>2021-08-06T22:19:18Z</wsu:created> </wsse:usernametoken> </wsse:security> </s:header> <s:body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <getprofiles xmlns="http://www.onvif.org/ver20/media/wsdl"> <type>All</type> </getprofiles> </s:body> </s:envelope>

    My request has an action and the camera returns a fault about the action cannot be handled

    digest :
    Request:

    POST /onvif/media_service HTTP/1.1
    Host: 172.19.235.162
    Content-Type: application/soap+xml; charset=utf-8
    Authorization: Digest username="admin",realm="iPolis",qop="auth",algorithm=MD5,uri="/onvif/media_service",nonce="610d9ba9cc43faf5168c",nc=00000003,cnonce="E5162834E27764825DA1F7BD954382E7",opaque="fa592b69",response="e00624526e97d9ca85b8cc588ed1528d"
    Content-Length: 318

    <s:envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <getprofiles xmlns="http://www.onvif.org/ver20/media/wsdl"> <type>All</type> </getprofiles> </s:body> </s:envelope>

    Again no action but also the "algorithm=MD5" is not in the request.

    I am writing now a minimal app with latest code to try differnt wsdl2h, soapcp2 flags and runtime flags.

     
  • Robert van Engelen

    I assume you have read the online gSOAP tutorials and manual by now, which have all the answers on how to use digest authentication: use the httpda plugin for HTTP digest authentication.

     
  • Robert van Engelen

    • status: open --> closed
     
  • Jeff Shanab

    Jeff Shanab - 2021-08-19

    Thanks.

     

Log in to post a comment.