×

Warning message

  • Cisco Support Forums is in Read Only mode while the site is being migrated.
  • Cisco Support Forums is in Read Only mode while the site is being migrated.

RPC Argument Passing

Answered Question
Jul 23rd, 2012
User Badges:

Hi,


I am trying to set up an RPC detector that runs an applet. The Applet currently just contains CLI commands, but I would like to use arguments passed from the SOAP request in the CLI commands. From the RPC syntax, the following should be accepted:


<?xml version="1.0"?>

<SOAP:Envelope xmlns:SOAP="http://www.cisco.com/eem.xsd">

<SOAP:Body>

  <run_emscript>

    <script_name> name of script </script_name>

    <argc> argc value </argc>

    <arglist>

    <l> argv1 value </l>

    <l> argv2 value </l>

          ...

    <l> argvn value </l>

    </arglist>

  </run_Eemscript>

</SOAP:Body>

</SOAP:Envelope>


My simple message is as follows:

<?xml version="1.0" encoding="UTF-8"?>

<SOAP:Envelope xmlns:SOAP="http://www.cisco.com/eem.xsd">

  <SOAP:Body>

    <run_eemscript>

      <script_name>Event_RPC</script_name>

      <argc> argc test </argc>

      <arglist>

           <l> argv1 100</l>

       </arglist>

    </run_eemscript>

  </SOAP:Body>

</SOAP:Envelope>


However, whenever the <arglist> is included I receive an error code response. I would expect the arglist to be accepted and an action command something like the following to be accepted:


action 1.0 cli command "switchport access vlan $_rpc_arg1"


Has anyone had experience with this?


Thanks,

Jason

Correct Answer by Joe Clarke about 5 years 4 weeks ago

That's an (ell) not a <1>.  Your arguments are:


100

200

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Joe Clarke Mon, 07/23/2012 - 07:52
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

You need to omit the "argc" and "argv" literals.  Your SOAP message will look like:


<?xml version="1.0" encoding="UTF-8"?>

http://www.cisco.com/eem.xsd">

 

   

      Event_RPC

      1

     

           100

      

   

 



Remember, argc is a count of the number of arguments.  You should also look at my Perl API for this.  It makes doing a lot of these things much easier.


https://supportforums.cisco.com/docs/DOC-19523

Jason Rossiter Mon, 07/23/2012 - 10:33
User Badges:

I have tried the suggestion, but now receive the following response:


<?xml version="1.0" encoding="UTF-8"?>
http://www.cisco.com/eem.xsd">
 
   
      Event_RPC
      2
     
        <1>100
        <2>200
 
   
 
]]>]]>


got data:

"<?xml version=\"1.0\" encoding=\"UTF-8\"?>http://www.cisco.com/eem.xsd\">-15844577'Embedded Event Manager' detected the 'fatal' condition 'unknown event ID']]>]]>\r\n"

Correct Answer
Joe Clarke Mon, 07/23/2012 - 10:43
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

That's an (ell) not a <1>.  Your arguments are:


100

200

Actions

This Discussion

Related Content