Cannot create soap 1.2 compatible requests.
Development toolkit for Web Services and XML data bindings for C & C++
Brought to you by:
engelen
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.
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.
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
<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>Host: 172.19.235.162
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 897
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
<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>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
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.
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.
Thanks.