Axis Customer Forum Index Axis Customer Forum
 FAQFAQ   SearchSearch   -1 -1 <-1>
 ProfileProfile   

ONVIF

 
Post new topic   Reply to topic    Axis Customer Forum Index -> Development
View previous topic :: View next topic  
Author Message
Stephane Pigeon



Joined: 27 Jul 2010
Posts: 2

PostPosted: Tue Jul 27, 2010 3:27 am    Post subject: ONVIF Reply with quote

Hello,

I searched ONVIF in the forums, and it doesn't seem to be a very popular topic... Sad

Has anyone had success using ONVIF to communicate with an ONVIF-compliant camera?

I have compiled the WSDL documents from ONVIF with wsdl.exe, and I'm trying simple stuff like GetProfiles, or GetWsdlUrl. I always get this error:

400 bad Request. Operation is not permitted

Anyone know how access control and certificates work in ONVIF?

Anyone have a WireShark capture, or a short piece of working code... ?You would have my eternal gratitude. Very Happy

Steph
Back to top
View user's profile
Stephane Pigeon



Joined: 27 Jul 2010
Posts: 2

PostPosted: Wed Jul 28, 2010 3:42 pm    Post subject: Reply with quote

If anyone is interested, I figured it out.

Camera manufacturers implement access security with WS-Security, but that is not necessarily specified in their WSDL templates.

On a hunch, I tried the simple UsernameToken method, and now I can talk to the camera. I have WireShark logs, if anyone needs them as examples.
Back to top
View user's profile
Brian Koetting



Joined: 10 Aug 2010
Posts: 1

PostPosted: Tue Aug 10, 2010 8:45 pm    Post subject: Reply with quote

Stephane Pigeon wrote:
I have WireShark logs, if anyone needs them as examples.


I am interested! I'm at the same point. I would greatly appreciate a pcap file.
Back to top
View user's profile
Carl Are Dreier Hopen



Joined: 13 Aug 2010
Posts: 2

PostPosted: Fri Aug 13, 2010 1:00 pm    Post subject: Reply with quote

I can't even get the wsdl util to generate what it should.

Quote:

C:\Test>wsdl /l:CS /protocol:SOAP http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.
Warning: This web reference does not conform to WS-I Basic Profile v1.1.
SOAP 1.1 binding was not found: WS-I's Basic Profile 1.1 consists of implementation guidelines that recommend how a set of core Web services specifications should be used together to develop interoperable Web services. For the 1.1 Profile,
those specifications are SOAP 1.1, WSDL 1.1, UDDI 2.0, XML 1.0 and XML Schema.

For more details on the WS-I Basic Profile v1.1, see the specification
at http://www.ws-i.org/Profiles/BasicProfile-1.1.html.

Warning: no classes were generated.
Warnings were encountered. Review generated source comments for more details.

Writing file 'C:\Test\output.cs'.

C:\Test>



Any tips?
Back to top
View user's profile
Carl Are Dreier Hopen



Joined: 13 Aug 2010
Posts: 2

PostPosted: Thu Aug 19, 2010 4:32 pm    Post subject: Reply with quote

I figured out that my problem there was the protocol param, should have used SOAP12 instead.

Using the correct protocol I was able to get the output I was trying to get. But beeing new to using Web Services I didn't know that I would need to get the WDSL from the actual unit and do this in runtime. Something I haven't figured out how to do in .NET yet.

Any tips would be appreciated.
Back to top
View user's profile
Michal Jaskurzynski



Joined: 25 Sep 2011
Posts: 1

PostPosted: Sun Sep 25, 2011 10:57 am    Post subject: Reply with quote

Stephane Pigeon wrote:
I have WireShark logs, if anyone needs them as examples.


I am also interested. Can you send me this logs?
Back to top
View user's profile
epronovostvi



Joined: 03 Feb 2012
Posts: 1

PostPosted: Fri Feb 03, 2012 12:30 am    Post subject: Onvif authentification Reply with quote

I'm using C# (Visual Studio 10). I'm able to access to simple Onvif commands, but not the ones that requires a username/password.

How do I perform the authentification?
Code:

         String s = "http://" + m_sAddress + "/onvif/device_service";
         EndpointAddress endpoint = new EndpointAddress(s);
         CustomBinding bind = new CustomBinding("DeviceBinding");

         // Create WS client
         Onvif.DeviceMgmt.DeviceClient(bind, endpoint);
         m_oClient = new Onvif.DeviceMgmt.DeviceClient(bind, endpoint);

            String[] arrayString = new String[4];
            String res = m_oClient.GetDeviceInformation(out arrayString[0], out arrayString[1], out arrayString[2], out  arrayString[3]);
Back to top
View user's profile
youdhbir singh



Joined: 11 Feb 2012
Posts: 2

PostPosted: Wed Feb 15, 2012 12:29 pm    Post subject: Re: ONVIF Reply with quote

Hello Mr. Stephane,

I am also following WSDL (OnVif) approach to control a PTZ camera. But while connecting and accessing utilities like GetNodes it throws an exception i.e. "Underlying connection was closed. The connection closed unexpectedly".

Your help would be highly appericiated.

My Code :


PTZClient PTZ = new PTZClient("PTZBinding_PTZ", "http://www.onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl");

PTZ.Open();

PTZNode[] plist = PTZ.GetNodes();
string s = plist[0].token;

PTZVector objPTZVector = new PTZVector();
Vector2D objVector2D = new Vector2D();
Vector1D objVector1D = new Vector1D();

objVector2D.x = 24;
objVector2D.y = 50;
objVector1D.x = 20;

objPTZVector.PanTilt = objVector2D;
objPTZVector.Zoom = objVector1D;

PTZSpeed PTZS = new PTZSpeed();

PTZS.PanTilt = objVector2D;
PTZS.Zoom = objVector1D;

PTZ.AbsoluteMove("Profile1", objPTZVector, PTZS);
Back to top
View user's profile
Alexander Maslakov



Joined: 15 Feb 2012
Posts: 1

PostPosted: Wed Feb 15, 2012 3:42 pm    Post subject: Reply with quote

Hi! I want to connect to camera by PHP SOAP and I want to get Wsdl URL for working with service but always get "Action failed" message.

PHP code sample:

Code:
try {
    $HeaderSecurity = array(
   "UsernameToken" => array(
       "Username" => 'user',
       "Password" => 'zAD2ZmZBLi5Dt6cgEgZphHT2kzg=',
       'Nonce'    => 'leJ8YlvIbk+WSiGSZhE8twcAAAAAAAAAwY7fOQQAAAA=',
       'Created'  => '2012-02-14T13:14:41.960Z',
   ),
    );

    $headers = array();
    $headers[] = new SoapHeader("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security", $HeaderSecurity, true);

    $location = 'http://11.111.111.111:8444/onvif/services';

    $client = new SoapClient(null, array(
   'location' => $location,
   'uri'      => 'urn:xmethods-delayed-quotes',
   'soap_version'   => SOAP_1_2,
   'style'    => SOAP_RPC,
   'use'      => SOAP_ENCODED,
   'encoding' => 'UTF-8',
   'trace'    => 1,
   //'cache_wsdl' => WSDL_CACHE_BOTH,
    ));

    //$client->__setSoapHeaders($headers);

    $result = $client->GetWsdlUrl();
    var_dump($result);
} catch (Exception $e) {
    echo '<pre>';
    var_dump($e);
    var_dump($client->__getLastRequestHeaders());
    var_dump($client->__getLastRequest());
    var_dump($client->__getLastResponse());
}


We try to connect wit / without SOAP Sequrity header. We try different variants of request.

Can anyone present samples of right requests? How to get Wsdl URL of camera ONVIF service?

Thanks.
Back to top
View user's profile
bharat gohil



Joined: 31 Dec 2009
Posts: 2

PostPosted: Sat May 19, 2012 6:14 am    Post subject: How to get WSDL version of an ONVIF camera?? :?: Reply with quote

Hello friends,

I am developing an application for the ONVIF camera support in C and found that there are two services which are being used by the cameras for PTZ.
Can I get which version the camera is using???? Question

Thanks & regards
Back to top
View user's profile
Angel Ruiz Sierra



Joined: 29 May 2012
Posts: 2

PostPosted: Tue May 29, 2012 4:33 pm    Post subject: Reply with quote

You can see some wsdl files on /usr/html/wsdl/onvif
You can acces them using any ftp client.
Back to top
View user's profile
Angel Ruiz Sierra



Joined: 29 May 2012
Posts: 2

PostPosted: Wed May 30, 2012 10:32 am    Post subject: Reply with quote

Alexander Maslakov wrote:
Hi! I want to connect to camera by PHP SOAP and I want to get Wsdl URL for working with service but always get "Action failed" message.

{---}

We try to connect wit / without SOAP Sequrity header. We try different variants of request.

Can anyone present samples of right requests? How to get Wsdl URL of camera ONVIF service?

Thanks.


I think you could find interesting this thread: http://stackoverflow.com/questions/5180192/onvif-authentication-failure-with-axis-p3301-using-onvif-protocol

Also, if you are using a relatively new firmware on your camera, Onvif is "disabled" and respond with a SOAP Fault: The action requested requires authorization and the sender is not authorized, unless you ADD a new ONVIF user. This user must be added on the following URL: http://camer_ip/admin/onvif.shtml?id=27 which is on Setup -> System Options -> Security -> ONVIF
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Axis Customer Forum Index -> Development All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group