Technical Committee |
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.
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.
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:
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:
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:
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
Copyright © 2010 - 2011 ONVIF. All Rights Reserved. |