vendredi 31 juillet 2015

Add Action Rule Axis Camera

I am trying to use the vapix API for Axis cameras to make a new action rule. The responses for this API are hilariously unhelpful. My error is : "The requested SOAP action failed" . I am using SOAPUI 5.2.0. Here is my code:

<soap:Envelope xmlns:soap="http://ift.tt/18hkEkn" xmlns:SOAP-ENC="http://ift.tt/1cvL1jU" xmlns:xsi="http://ift.tt/ra1lAU" xmlns:xsd="http://ift.tt/tphNwY" xmlns:c14n="http://ift.tt/11kTCUR" xmlns:wsu="http://ift.tt/Hm2joJ" xmlns:ds="http://ift.tt/uq6naF" xmlns:wsse="http://ift.tt/LRW8Ij" xmlns:wsa5="http://ift.tt/HKXHai" xmlns:xmime="http://ift.tt/1LP4jbf" xmlns:xop="http://ift.tt/1euX8oV" xmlns:wsrfbf="http://ift.tt/1cvL1Ai" xmlns:wstop="http://ift.tt/1cvL3s5" xmlns:tt="http://ift.tt/1cvL1Ag" xmlns:acert="http://ift.tt/1DWHUkg" xmlns:wsrfr="http://ift.tt/1leiF5D" xmlns:aa="http://ift.tt/1LP4jbj" xmlns:acertificates="http://ift.tt/1IzbYrz" xmlns:aev="http://ift.tt/1LP4iUP" xmlns:ali1="http://ift.tt/1LP4jrz" xmlns:ali2="http://ift.tt/1MSjz49" xmlns:ali3="http://ift.tt/1LP4jrB" xmlns:ali4="http://ift.tt/1LP4lQh" xmlns:ali="http://ift.tt/1LP4lQk" xmlns:apc="http://ift.tt/1DWHWsr" xmlns:arth="http://ift.tt/1IzbWA7" xmlns:aweb="http://ift.tt/1DWHUAE" xmlns:tan1="http://ift.tt/1MSjz4d" xmlns:tan2="http://ift.tt/1LP4jrG" xmlns:tan="http://ift.tt/1leiDe2" xmlns:tds="http://ift.tt/1leiEPp" xmlns:tev1="http://ift.tt/1cvL1Au" xmlns:tev2="http://ift.tt/1cvL3Ix" xmlns:tev3="http://ift.tt/1leiF5N" xmlns:wsnt="http://ift.tt/1leiEPh" xmlns:tev4="http://ift.tt/1leiDuF" xmlns:tev="http://ift.tt/1cvL3Ik" xmlns:timg="http://ift.tt/1sSAh9q" xmlns:tptz="http://ift.tt/1cvL3Is" xmlns:trt="http://ift.tt/1cvL0wr" xmlns:ter="http://ift.tt/1leiEyG" xmlns:tns1="http://ift.tt/1cvL3rY" xmlns:tnsaxis="http://ift.tt/1MSjxcw">
  <soap:Header/>
  <soap:Body>
    <act:AddActionRule>
    <act:NewActionRule>
      <!--Optional:-->
      <act:Name>AHHHHH</act:Name>
      <act:Enabled>true</act:Enabled>
      <!--Optional:-->
      <!--<act:StartEvent>-->
      <!--You may enter ANY elements at this point-->
      <!--</act:StartEvent>-->
      <!--Optional:-->
      <act:Conditions>
        <!--1 or more repetitions:-->
        <act:Condition>
          <wsnt:TopicExpression Dialect="http://ift.tt/1IzbWQp">tns1:Device/ tnsaxis:IO/Port//.</wsnt:TopicExpression>
          <wsnt:MessageContent Dialect="http://ift.tt/1DWHWIR">boolean(//SimpleItem[@Name="state" and @Value="1"]) and boolean(//SimpleItem[@Name="port" and @Value="0"])</wsnt:MessageContent>
        </act:Condition>
      </act:Conditions>
      <!--Optional:-->
      <!--act:ActivationTimeout>?</act:ActivationTimeout-->
      <act:PrimaryAction>16</act:PrimaryAction>
      <!--Optional:-->
      <!--act:FailoverAction>?</act:FailoverAction-->
    </act:NewActionRule>
  </act:AddActionRule>
</soap:Body>

To be honest I am not sure what the things inside the condition are doing. I went into the camera setup and added the action rule through the setup, then used another soap command "GetActionRules" to see how to format it. The GeActionRules command is

<soap:Envelope xmlns:soap="http://ift.tt/18hkEkn" xmlns:act="http://ift.tt/1LP4jbj">
   <soap:Header/>
   <soap:Body>
      <act:GetActionRules/>
   </soap:Body>
</soap:Envelope>

And the response is

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://ift.tt/18hkEkn" xmlns:SOAP-ENC="http://ift.tt/1cvL1jU" xmlns:xsi="http://ift.tt/ra1lAU" xmlns:xsd="http://ift.tt/tphNwY" xmlns:c14n="http://ift.tt/11kTCUR" xmlns:wsu="http://ift.tt/Hm2joJ" xmlns:ds="http://ift.tt/uq6naF" xmlns:wsse="http://ift.tt/LRW8Ij" xmlns:wsa5="http://ift.tt/HKXHai" xmlns:xmime="http://ift.tt/1LP4jbf" xmlns:xop="http://ift.tt/1euX8oV" xmlns:wsrfbf="http://ift.tt/1cvL1Ai" xmlns:wstop="http://ift.tt/1cvL3s5" xmlns:tt="http://ift.tt/1cvL1Ag" xmlns:acert="http://ift.tt/1DWHUkg" xmlns:wsrfr="http://ift.tt/1leiF5D" xmlns:aa="http://ift.tt/1LP4jbj" xmlns:acertificates="http://ift.tt/1IzbYrz" xmlns:aev="http://ift.tt/1LP4iUP" xmlns:ali1="http://ift.tt/1LP4jrz" xmlns:ali2="http://ift.tt/1MSjz49" xmlns:ali3="http://ift.tt/1LP4jrB" xmlns:ali4="http://ift.tt/1LP4lQh" xmlns:ali="http://ift.tt/1LP4lQk" xmlns:apc="http://ift.tt/1DWHWsr" xmlns:arth="http://ift.tt/1IzbWA7" xmlns:aweb="http://ift.tt/1DWHUAE" xmlns:tan1="http://ift.tt/1MSjz4d" xmlns:tan2="http://ift.tt/1LP4jrG" xmlns:tan="http://ift.tt/1leiDe2" xmlns:tds="http://ift.tt/1leiEPp" xmlns:tev1="http://ift.tt/1cvL1Au" xmlns:tev2="http://ift.tt/1cvL3Ix" xmlns:tev3="http://ift.tt/1leiF5N" xmlns:wsnt="http://ift.tt/1leiEPh" xmlns:tev4="http://ift.tt/1leiDuF" xmlns:tev="http://ift.tt/1cvL3Ik" xmlns:timg="http://ift.tt/1sSAh9q" xmlns:tptz="http://ift.tt/1cvL3Is" xmlns:trt="http://ift.tt/1cvL0wr" xmlns:ter="http://ift.tt/1leiEyG" xmlns:tns1="http://ift.tt/1cvL3rY" xmlns:tnsaxis="http://ift.tt/1MSjxcw">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <aa:GetActionRulesResponse>
         <aa:ActionRules>
            <aa:ActionRule>
               <aa:RuleID>8</aa:RuleID>
               <aa:Name>FTP</aa:Name>
               <aa:Enabled>true</aa:Enabled>
               <aa:Conditions>
                  <aa:Condition>
                     <wsnt:TopicExpression Dialect="http://ift.tt/1IzbWQp">tns1:Device/tnsaxis:IO/Port//.</wsnt:TopicExpression>
                     <wsnt:MessageContent Dialect="http://ift.tt/1DWHWIR">boolean(//SimpleItem[@Name="port" and @Value="0"]) and boolean(//SimpleItem[@Name="state" and @Value="1"])</wsnt:MessageContent>
                  </aa:Condition>
               </aa:Conditions>
               <aa:PrimaryAction>13</aa:PrimaryAction>
           </aa:ActionRule>
            <aa:ActionRule>
               <aa:RuleID>9</aa:RuleID>
               <aa:Name>noobbbb</aa:Name>
               <aa:Enabled>true</aa:Enabled>
               <aa:Conditions>
                  <aa:Condition>
                     <wsnt:TopicExpression Dialect="http://ift.tt/1IzbWQp">tns1:Device/tnsaxis:IO/Port//.</wsnt:TopicExpression>
                     <wsnt:MessageContent Dialect="http://ift.tt/1DWHWIR">boolean(//SimpleItem[@Name="port" and @Value="0"]) and boolean(//SimpleItem[@Name="state" and @Value="1"])</wsnt:MessageContent>
                  </aa:Condition>
               </aa:Conditions>
               <aa:PrimaryAction>14</aa:PrimaryAction>
            </aa:ActionRule>
         </aa:ActionRules>
      </aa:GetActionRulesResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Aucun commentaire:

Enregistrer un commentaire