none
Wrong version xmlns for discovery RRS feed

  • Question

  • I am trying to create an application to connect to my CCTV cameras that support ONVIF.  I am using the classes in the System.ServiceModel.Discovery namespace starting with the Calculator example provided in the SDK.

    The calculator sample builds and runs just fine.  My only change was to remove the FindCriteria for the iCalculator type so that the FindAsync call should return any device discoverable by ws-discovery.  When I run it this way it still finds the calculator service from the example but it fails to find the ONVIF compatible cameras.  The cameras report back that the action in the probe is not supported.

    With WireShark I found that the Action sent by the probe is:

    <a:Action s:mustUnderstand="1">http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Probe</a:Action>

    The fault reason from the camera is:

    <SOAP-ENV:Reason><SOAP-ENV:Text xml:lang="en">The [action] cannot be processed at the receiver.</SOAP-ENV:Text></SOAP-ENV:Reason>

    It appears that the cause is that the ONVIF standard expects a different version of the Probe, http://schemas.xmlsoap.org/ws/2005/04/discovery/.

    I can't see any other reason for the exception other than the xmlns version.  Is there a way to force the WCF Discovery code to use a certain version?  Or any other thoughts on what may cause the issue?


    Thursday, January 8, 2015 6:26 AM

All replies

  • in case it helps, here's the WireShark capture of the Request from the client:

    <s:Envelope 
      xmlns:s="http://www.w3.org/2003/05/soap-envelope" 
      xmlns:a="http://www.w3.org/2005/08/addressing">
    <s:Header>
      <a:Action s:mustUnderstand="1">http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Probe</a:Action>
      <a:MessageID>urn:uuid:b4cc958c-a260-439c-8da0-aaf99b9162a2</a:MessageID>
      <a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo>
      <a:To s:mustUnderstand="1">urn:docs-oasis-open-org:ws-dd:ns:discovery:2009:01</a:To>
      <VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPowt4GUuON7dLiPmPIRjJuqcAAAAApaUFpWoPukG1L3O4DBYmv/qw02VztstOtHBCxlRrf+4ACQAA</VsDebuggerCausalityData>
    </s:Header>
    <s:Body>
      <Probe xmlns="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01">
        <Duration xmlns="http://schemas.microsoft.com/ws/2008/06/discovery">PT25S</Duration>
      </Probe>
    </s:Body>
    </s:Envelope>

    Response from camera:

    <?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:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
      xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" 
      xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" 
      xmlns:wsa5="http://www.w3.org/2005/08/addressing" 
      xmlns:xmime="http://www.w3.org/2005/05/xmlmime" 
      xmlns:xop="http://www.w3.org/2004/08/xop/include" 
      xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" 
      xmlns:tt="http://www.onvif.org/ver10/schema" 
      xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" 
      xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" 
      xmlns:ns1="http://www.onvif.org/ver10/actionengine/wsdl" 
      xmlns:tad="http://www.onvif.org/ver10/analyticsdevice/wsdl" 
      xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" 
      xmlns:tdn="http://www.onvif.org/ver10/network/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: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://schemas.xmlsoap.org/ws/2005/02/sc" 
      xmlns:ds="http://www.w3.org/2000/09/xmldsig#" 
      xmlns:ws="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
      xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" 
      xmlns:tls="http://www.onvif.org/ver10/display/wsdl" 
      xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" 
      xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" 
      xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" 
      xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" 
      xmlns:trt="http://www.onvif.org/ver10/media/wsdl" 
      xmlns:trv="http://www.onvif.org/ver10/receiver/wsdl" 
      xmlns:ter="http://www.onvif.org/ver10/error" 
      xmlns:tse="http://www.onvif.org/ver10/search/wsdl" 
      xmlns:tns1="http://www.onvif.org/ver10/topics">
    <SOAP-ENV:Header>
      <wsa:To SOAP-ENV:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
      <wsa:Action SOAP-ENV:mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
        <SOAP-ENV:Code>
          <SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value>
          <SOAP-ENV:Subcode>
            <SOAP-ENV:Value>wsa:ActionNotSupported</SOAP-ENV:Value>
          </SOAP-ENV:Subcode>
        </SOAP-ENV:Code>
        <SOAP-ENV:Reason>
          <SOAP-ENV:Text xml:lang="en">The [action] cannot be processed at the receiver.</SOAP-ENV:Text>
        </SOAP-ENV:Reason>
      </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    Thursday, January 8, 2015 6:19 PM
  • Here is a discovery request using a different tool that worked.  Though this request has the NetworkVideoTransmitter type in the request, I don't think this is my problem since without the type every ws-discovery enabled device should respond.  I am more convinced that the problem is the version of probe described in the request.  

    <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
      xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing">
      <s:Header>
        <a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe</a:Action>
        <a:MessageID>uuid:6b73d132-5879-45f5-805a-d42ccae4ace6</a:MessageID>
        <a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>
        <a:To s:mustUnderstand="1">urn:schemas-xmlsoap-org:ws:2005:04:discovery</a:To>
        <VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPo3KnXl6xDulFkAvff56xHDsAAAAAztlptTVNfkydxgxh2xqd578TH+KcN/1NkJ5XKlX7lXUACQAA</VsDebuggerCausalityData>
      </s:Header>
      <s:Body>
        <Probe xmlns="http://schemas.xmlsoap.org/ws/2005/04/discovery">
          <d:Types xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:dp0="http://www.onvif.org/ver10/network/wsdl">
            dp0:NetworkVideoTransmitter
          </d:Types>
        </Probe>
      </s:Body>
    </s:Envelope>

    I discovered and played with some of the samples and descriptions in System.ServiceModel.Discovery.VersionApril2005 namespace but this did not change the content of the probe action; even when VersionApril2005 is specified in the config file the request still specifies 2009/01 version.

    Is there any way at all to customize the content on the discovery requests or will I have to resort to writing my own discovery code?

    Monday, January 12, 2015 5:37 AM
  • Can you post your config file?
    Monday, January 12, 2015 7:31 AM