thchu168 / java-ws-discovery

Automatically exported from code.google.com/p/java-ws-discovery
GNU Lesser General Public License v3.0
0 stars 0 forks source link

onvif device discovery fails #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I used WsDiscoveryFinderExample and made below changes:
    QName myPortType = new QName("http://www.onvif.org/ver10/network/wsdl", "NetworkVideoTransmitter", "dn");
and it couldn't find axis onvif enabled camera (for specific service)

However I tried another program which is Onvif Device Manager 
(http://sourceforge.net/projects/onvifdm/)
and this program finds the camera.

I compared created udp packets using Wireshark and there are slight differences 
between them.

java-ws-discovery udp-data:
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" 
    xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
    xmlns:wsd="http://schemas.xmlsoap.org/ws/2005/04/discovery">
    <env:Header>
        <wsd:AppSequence InstanceId="1323359689465" MessageNumber="1" SequenceId="urn:uuid:bdfcafd1-39e0-4edb-a8f7-7ba9ea3e54f7"/>
        <wsa:To>urn:schemas-xmlsoap-org:ws:2005:04:discovery</wsa:To>
        <wsa:Action>http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe</wsa:Action>
        <wsa:MessageID>urn:uuid:4e8815f2-8c93-4550-9bbf-926d6936bbae</wsa:MessageID>
    </env:Header>
    <env:Body>
        <wsd:Probe>
            <wsd:Types xmlns:dn="http://www.onvif.org/ver10/network/wsdl">dn:NetworkVideoTransmitter</wsd:Types>
        </wsd:Probe>
    </env:Body>
</env:Envelope>

Onvif device manager udp-data:
<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>urn:uuid:e8347b80-f991-4938-997f-3f8323514729</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>
    </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>

It seems there some missing and extra parts.

Thanks in advance.

Original issue reported on code.google.com by ilhan.m...@gmail.com on 15 Dec 2011 at 4:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hello,

i'm using  the same lib for implement ONVIF NVT device discovery.
I'm able to find Sunell camera with java-ws-discovery but with Axis camera i 
have the same issue of you. I'm using Axis M1011 with WebService enabled.

Have you found a solution?
Are you able to discovery Axis camera on your network with java-ws-discovery?

Thanks,
Oscar

Original comment by oscar...@gmail.com on 10 Feb 2012 at 8:47

GoogleCodeExporter commented 9 years ago
Hello,

We couldn't find a soloution... However we can discover Axis camera with UPnP.

Original comment by ilhan.m...@gmail.com on 13 Feb 2012 at 4:01

GoogleCodeExporter commented 9 years ago
Ok,Thanks. 

I will try with an UPnP lib.

Original comment by oscar...@gmail.com on 13 Feb 2012 at 6:23

GoogleCodeExporter commented 9 years ago
Hi, 

I have also the same problem. 

It seems to be the version to use with the Ws-Discovery standard.  By default, 
the library use "http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01" 
namespaces. But in the ONVIF documentation, discovery should be implemented AT 
LEAST namespace "http://schemas.xmlsoap.org/ws/2005/04/discovery".

Using the default solution won't work. You have to modify the 
"WsDiscoveryConstants.defaultNsDiscovery" (in the source code) in order to 
support 2005 version.

My code does not find WS but publish WS, and it works fine with this workaround.

Hugo

Original comment by hugotere...@gmail.com on 23 Mar 2012 at 3:13