An error occurred while calling setimagingsettings in onvif imaging. WSDL.
This should be a bug in the onvif official document !! I sent an email to their technical support and asked if it was in a WSDL document.
Bug. The answer is: not their co-workers do not provide technical support.
.... Fuck this Organization !!!
My code is generated using gsoap. In the forcepersistence _ attribute of imaging. WSDL, there is a space after it, as shown below:
Http://www.onvif.org/ver20/imaging/wsdl/imaging.wsdl to find forcepersistence:
<Xs: element name = "setimagingsettings">
<Xs: complextype>
<Xs: sequence>
<Xs: element name = "videosourcetoken" type = "TT: referencetoken"/>
<Xs: element name = "imagingsettings" type = "TT: imagingsettings20"/>
<Xs: element name = "forcepersistence" type = "XS: Boolean" maxoccurs = "1" minoccurs = "0"/>
</Xs: sequence>
</Xs: complextype>
</Xs: Element>
Note that the name = "forcepersistence" in the above element node has a space, so when we use gsoap to generate the header file:
The following code is available:
/// Top-level root element "http://www.onvif.org/ver20/imaging/wsdl": setimagingsettings
// "Http://www.onvif.org/ver20/imaging/wsdl": setimagingsettings is a complextype.
Struct _ NS1 _ setimagingsettings
{
// Element videosourcetoken of type "http://www.onvif.org/ver10/schema": referencetoken.
Ns__ referencetoken videosourcetoken 1; // <required element.
// Element imagingsettings of type "http://www.onvif.org/ver10/schema": imagingsettings20.
Struct ns__ imagingsettings20 * imagingsettings 1; // <required element.
/// Element forcepersistence of Type Xs: Boolean.
Enum XSD _ Boolean * forcepersistence_x0020 0; // <optional element.
};
Note that the preceding "forcepersistence_x0020" x002 is the extra space.
This is the cause of the error.
The solution is simple. You can save the WSDL to your local device and modify it.
<Xs: element name = "forcepersistence" type = "XS: Boolean" maxoccurs = "1" minoccurs = "0"/>
Remove spaces and generate a new. h file.
Of course, you can also generate a. h file and change the. h file to forcepersistence_x0020 _
This can also be done.