When setimagingsettings is called in onvif imaging. WSDL, is an error reported?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.