Skip to content

Base library that provides connectivity with the new Action and Event web-services API for Axis network camera / devices

License

Notifications You must be signed in to change notification settings

dtrammer/AxisActionEventLib

Repository files navigation

C# AxisActionEventLib 1.1

Base library that provides connectivity with the new Action and Event web-services API of Axis network cameras or devices.

It uses HTTP communication with SOAP/XML message content.

Prerequisite & install

  • .net 4.5.2
  • Download the AxisActionEventLib.dll and add it as a reference to your VS project Use the object browser to explore the ActionEventLib namespace

Actions & Events principles

To understand the concept, structure and terminology of the Action & Event webservices have a look at the official documentation here : http://www.axis.com/files/manuals/vapix_event_action_56628_en_1404.pdf. The library encapsulates and provides strongly typed objects for all the concepts described in the document.

Based on services wsdl's :

Comments

  • Events are represented by ActionRule instances, it specifies how and when the Axis product performs an action. Example: record video when motion is detected outside office hours. An action rule consists of:

    • a start event
    • one or more conditions
    • a primary action

    The primary action will be executed when the start event occurs and all specified conditions are fulfilled. The start event can be omitted. Conditions can also be omitted, but either a start event or at least one condition must be specified. The action will be stopped when any of the conditions is no longer fulfilled.

  • The default service address of Axis devices is http://yourip/vapix/services, this is used by default. This can be changed by assigning the Service_URL property of a service object

  • All Action|Event services instance methods are asynchronous

Quick samples

  • For more samples have a look at the test class in the UnitTest folder

  • Get Action | Recipient Templates

    ActionService actionService = new ActionService();

    GetActionTemplatesResponse actionTemplates = await actionService.GetActionTemplatesAsync( "192.168.1.10" , "root" , "pass" );

  • Get EventInstances

    EventService eventService = new EventService();

    GetEventInstancesResponse eventInstances = await eventService.GetEventsInstancesAsync( "192.168.1.10" , "root" , "pass" );

  • Create a new Actionrule (event)

    Unless you know the different parameters that compose an ActionConfiguration template and Event Instance it's recommended that you first use the GetActionTemplates method and the GetEventInstances method to get the supported templates and events instances for the targeted device. This will also provide you with strongly typed instances that you can use directly to setup the action rule, example :

    • See the "Setup_ActionRule_Full_Sample" test method of the test class in the UnitTest folder

Additional info

The responses instances returned by the Action|Event services methods all share the same base type "ServiceResponse". The more specific types only add one or more extra members.(ex.: GetActionTemplatesResponse will only append a new Dictionary member)

ServiceResponse
IsSuccessboolTrue if request succeeded with HTTP status 200, False in all other cases
HttpStatusCodeHttpStatusCodeThe status code of the http response
ContentstringWill contain the result of the request if it succeeded, in all other cases it will contain the response body or exceptions messages
SOAPContentXElementXML DOM object containing the SOAP/XML response body of a successfull request

About

Base library that provides connectivity with the new Action and Event web-services API for Axis network camera / devices

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages