I was working with gsoap and onvif, few days ago I encountered an error SOAP_TYPE Here is the command i used with wsdl2h and soapcpp2:
wsdl2h -P -x -Ie:\gsoap2.8.24\gsoap -o onvif.h http://www.onvif.org/onvif/ver20/analytics/wsdl/analytics.wsdl ....
soapcpp2 -j2Cx -IE:\gsoap2.8.24\gsoap;E:\gsoap2.8.24\gsoap\import onvif.h
I was just implementing this simple wsdl function to ask for information from Analytics Service of ONVIF http://www.onvif.org/onvif/ver20/analytics/wsdl/analytics.wsdl#op.GetServiceCapabilities
Here is the simplified fucntion code:
~~~~
struct soap soapdata;
soap_init(&soapdata);
RuleEngineBindingProxy onvifRuleEngine(&soapdata);
/*---------------------------------------------------------*/
_tan__GetServiceCapabilities tan__GetServiceCapabilitiesRequest;
_tan__GetServiceCapabilitiesResponse tan__GetServiceCapabilitiesResponse;
result = onvifRuleEngine.GetServiceCapabilities(analyticsEndpoint, NULL, &tan__GetServiceCapabilitiesRequest, tan__GetServiceCapabilitiesResponse);
if (result == SOAP_OK) {
cout << tan__GetServiceCapabilitiesResponse.Capabilities->AnalyticsModuleSupport << endl;
}
else cout << "Error: " << soapdata.error << endl;
~~~~
But the gsoap status returns error 4 which is
SOAP_TYPE: An XML Schema type mismatch
I did not see any error in log files, in TEST.log there are some PUSH NOT OK but i think it's not a problem, it sent and received XML messages properly and I attached it below, but the function returns error 4
The other service like Device and Media I can run properly without error
SENT.log
POST /onvif/Analytics HTTP/1.1
Host: remotedacrib.dynip.sapo.pt
User-Agent: gSOAP/2.8
Content-Type: application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/analytics/wsdl/GetServiceCapabilities"
Content-Length: 1444
Connection: close
SOAPAction: "http://www.onvif.org/ver20/analytics/wsdl/GetServiceCapabilities"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:wsc="http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:trt="http://www.onvif.org/ver10/media/wsdl"><SOAP-ENV:Body><tan:GetServiceCapabilities></tan:GetServiceCapabilities></SOAP-ENV:Body></SOAP-ENV:Envelope>
RECV.log
HTTP/1.1 200 OK
Date: Tue, 01 Dec 2015 10:39:27 GMT
Server: App-webs/
Connection: close
Content-Length: 2033
Content-Type: application/soap+xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tst="http://www.onvif.org/ver10/storage/wsdl" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:dn="http://www.onvif.org/ver10/network/wsdl" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl" xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12" xmlns:http="http://schemas.xmlsoap.org/wsdl/http" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsadis="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2" xmlns:wsrf-rw="http://docs.oasis-open.org/wsrf/rw-2" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-2" xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tnshik="http://www.hikvision.com/2011/event/topics"><env:Body><tan:GetServiceCapabilitiesResponse><tan:Capabilities RuleSupport="TRUE" AnalyticsModuleSupport="TRUE" CellBasedSceneDescriptionSupported="FALSE"/>
</tan:GetServiceCapabilitiesResponse>
</env:Body>
</env:Envelope>