Onvif device (camera) is not found during discovery

1.9k views Asked by At

I'm working on Camera firmware to support ONVIF specs (using Java). I'm using Apache CXF to run services. I've imported remotediscovery.wsdl and devicemngmt.wsdl and created services for them.

I'm sure the services are running and bound to SOAP UDP:

Starting Server
[Fatal Error] addressing:2:2: The markup in the document following the root element must be well-formed.
28.11.2014 16:01:12 org.apache.cxf.service.factory.ReflectionServiceFactoryBean isEmptywsdl
28.11.2014 16:01:12 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
INFO: Creating Service {http://www.onvif.org/ver10/network/wsdl}DiscoveryService from class org.onvif.ver10.network.wsdl.DiscoveryLookupPort
28.11.2014 16:01:13 org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be http://localhost:8080/onvif/device_service
28.11.2014 16:01:13 org.eclipse.jetty.server.Server doStart
INFO: jetty-8.1.15.v20140411
28.11.2014 16:01:13 org.eclipse.jetty.server.AbstractConnector doStart
INFO: Started SelectChannelConnector@localhost:8080
28.11.2014 16:01:13 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL
INFO: Creating Service {http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Discovery from WSDL: classpath:/org/apache/cxf/ws/discovery/wsdl/wsdd-discovery-1.1-wsdl-os.wsdl
28.11.2014 16:01:13 org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be soap.udp://239.255.255.250:3702
28.11.2014 16:01:13 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
INFO: Creating Service {http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}DiscoveryProxy from class org.apache.cxf.jaxws.support.DummyImpl
Starting Server
28.11.2014 16:01:31 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL
INFO: Creating Service {http://www.onvif.org/ver10/device/wsdl}DeviceService from WSDL: /tmp/wsdl/devicemgmt.wsdl
28.11.2014 16:01:51 org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be http://localhost:8080/onvif/DeviceService/device
Starting Server
[Fatal Error] addressing:2:2: The markup in the document following the root element must be well-formed.
28.11.2014 16:01:58 org.apache.cxf.service.factory.ReflectionServiceFactoryBean isEmptywsdl
28.11.2014 16:01:58 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
INFO: Creating Service {http://www.onvif.org/ver10/network/wsdl}DiscoveryService from class org.onvif.ver10.network.wsdl.RemoteDiscoveryPort
28.11.2014 16:01:58 org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be http://localhost:8080/service/DiscoveryService/discovery
Server ready...

I've tested it using CXF WSDiscoveryClient and they can be found:

16 clients found
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EndpointReference xmlns="http://www.w3.org/2005/08/addressing"><Address>http://localhost:8080/onvif/device_service</Address><ReferenceParameters/></EndpointReference>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EndpointReference xmlns="http://www.w3.org/2005/08/addressing"><Address>http://localhost:8080/onvif/DeviceService/device</Address><ReferenceParameters/></EndpointReference>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EndpointReference xmlns="http://www.w3.org/2005/08/addressing"><Address>http://localhost:8080/service/DiscoveryService/discovery</Address><ReferenceParameters/></EndpointReference>
...

But I can't see my device using SmartICRSS or any ONVIF client.

What's wrong? I expect my device to do discovered by WS-Discovery and then I expect probe method to be invoked by client. I have breakpoint in and it's not invoked.

PS. I've installed network traffic interceptor app and found that production IPCameras response with ProbeMatches response (in soap body) and CXF's impl does not reply. How can I make CXF service reply with ProbeMatches?

1

There are 1 answers

1
Ankit Gurung On

WS-Discovery is not ONVIF, it is a XML SOAP WS-Discovery

http://specs.xmlsoap.org/ws/2005/04/discovery/ws-discovery.pdf

And, the version you have to use: April2005 version11

Please refer https://code.google.com/p/java-ws-discovery/