Max Abzaloff
Max Abzaloff

Reputation: 41

Generating .java from onvif .wsdl

I write a Java app which work with camera. I get files from onvif site devicemgmt.wsdl and generate .java files using wsimport.exe. It works well but it has not enough methods for me. I need to receive events from the camera like motion detection or closing contacts of button. I tried to use deviceIOPort as .wsdl file.
One note: I added to my .wsdl file this service:

   <wsdl:service name="DeviceService">
         <wsdl:port name="DevicePort" binding="tds:DeviceBinding">
           <soap:address location="http://ip/onvif/device_service"/>
         </wsdl:port>
   </wsdl:service>

It works fine for devicemgmt.wsdl, but when I use this for deviceIOPort it works, but no new methods are added.

To generate java files, I use the command :

wsimport -d where_to_place_generated_files ..\deviceIOBinding.wsdl -keep -Xnocompile -verbose > ..\log.txt

How can I use deviceIOPort and add custom methods at the same time.

P.S. if you find mistakes send it to me, i am still learning english

Upvotes: 3

Views: 1413

Answers (1)

Max Abzaloff
Max Abzaloff

Reputation: 41

After i added to the file deviceIOPort.wsdl after <wsdl:binding> this:

   <wsdl:service name="DeviceService">
         <wsdl:port name="DeviceIOPort" binding="tmd:DeviceIOBinding">
            <soap:address location="http://ip/onvif/device_service"/>
         </wsdl:port>
         <wsdl:port name="MediaPort" binding="trt:MediaBinding">
            <soap:address location="http://ip/onvif/device_service"/>
         </wsdl:port>
        <wsdl:port name="DevicePort" binding="tds:DeviceBinding">
            <soap:address location="http://ip/onvif/device_service"/>
         </wsdl:port>
   </wsdl:service>

new methods were added and worked well for me.

And one note: i just download from www.onvif.org by wget all onvif files specifications and use it. If you want to download files separately and then use it you have to change in <import> location attribute.

Upvotes: 1

Related Questions