cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2428
Views
0
Helpful
4
Replies

RPC Argument Passing

Jason Rossiter
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

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

100

200

View solution in original post

4 Replies 4

Joe Clarke
Cisco Employee
Cisco Employee

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

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

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


http://www.cisco.com/eem.xsd">
 
   
      Event_RPC
      2
     
        <1>100

        <2>200

 
   

 
]]>]]>

got data:

"http://www.cisco.com/eem.xsd\">-15844577'Embedded Event Manager' detected the 'fatal' condition 'unknown event ID']]>]]>\r\n"

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

100

200

Thats it.

Thanks,

Jason

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: