Onvif
Technical Committee 

FAQ & Support

Table of Contents

  1. Why does compiling event.wsdl with Visual Studio fail?
  2. How to implement Digest Authentication with Microsoft WCF?
  3. Why does PullMessages return no messages with Visual Studio 2008?
  4. How to retrieve error information with Microsoft WCF?
  5. How to decode information in extension elements with Microsoft WCF?
  6. How to handle optional integer element with Microsoft WCF?
  7. For More Information

  1. Why does compiling event.wsdl with Visual Studio fail?

    Visual Studio 2008, 2010 and 2012 generate web services clients for the WCF framework with a tool called svcutil.exe. This tool has an issue by mapping port types to interfaces and complex types to classes. When an wsdl file contains a port type and complex type with same name this results in a name clash at compile time like "The namespace 'foo.Event' already contains a definition for 'CreatePullPoint' ".

    The ONVIFevent mechanism bases on OASIS Web Services Base Notification 1.3. As a result event.wsdl includes WS-Base-Notficiaton. This OASIS specification contains CreatePullPoint as port type and complex type which triggers the issue described above.

    As a workaround use a modified even.wsdl instead of standard event.wsdl for generating code. It refers to a modified ws base notification file. It is available via the following link.

  2. How to implement Digest Authentication with Microsoft WCF?

    Microsoft introduced with Visual Studio 2008 the WCF framework. This framework provides an extended range of authentication and transport mechanism for web services. Unfortuately it fails to support the ONVIF mandatory digest authentication mechanism. From VS 2010 on only WCF is supported

    The article UserNameToken Profile vs. WCF provides insight and also sample source code. Please notice that the SOAP version has to be adjusted from Soap11 to Soap12 in the BindingHelper class.

  3. Why does PullMessages return no messages with Visual Studio 2008?

    The Visual Studio 2008 web stub generation tool svcutil has an issue generating referenced collections of another namespace.
    Add in the generated event reference file "Reference.cs" the namespace explicitly for the XmlElementAttribute("NotificationMessage").
    Steps:


    Keep in mind that the change is overwritten any time you update the service reference.
    Note that the issue has been fixed since the Visual Studio 2010 Service Release.

  4. How to retrieve error information with Microsoft WCF?

    The WCF framework throws a FaultException for fault messages conveyed with http status code 2xx or 5xx. However in case of http status code 4xx a ProtocolException is thrown showing only the http status code.
    The code snippet below shows how to retrieve a FaultException containing fault code and subcodes from a WCF ProtocolException:



  5. How to decode information in extension elements with Microsoft WCF?

    The Microsoft parser doesn't distinguish between different types of any elements. This issue causes an incorrect processing of ONVIF extension elements. As a result the extension content may be parsed into the any element instead of the correct destination objects.
    See After you apply security update 931212, WSDL is no longer parsed correctly in the .NET Framework 2.0 for more details.
    As workaround:

    1. download the respective wsdl and onvif.xsd files.
    2. remove the any elements
    3. adjust the schema location in the wsdl file
    4. generate the stubs with the modified local version of the wsdl files


    Please note that this workaround fails when vendor specific extensions are applied.

  6. How to handle optional integer element with Microsoft WCF?

    The Microsoft WCF will parse an optional integer element of a response message which is "0" or "null" as the same value. E.g. it automatically replaces a non-existent integer value by "0". If a client wants to distinguish such integer element because of having different meaning for "null", it is possible to solve by manually putting the attribute of nillable="true" to the wsdl before generating a source code.

    Example: in case of GetGuaranteedNumberOfVideoEncoderInstances which has a meaning of "0" and "null", the wsdl has to be changed from


    to

  7. For More Information

    Table of Contents
Copyright © 2010 - 2011 ONVIF. All Rights Reserved.