07-23-2012 06:11 AM
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
Solved! Go to Solution.
07-23-2012 10:43 AM
07-23-2012 07:52 AM
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.
07-23-2012 10:33 AM
I have tried the suggestion, but now receive the following response:
<1>100
<2>200
]]>]]>
got data:
"
07-23-2012 10:43 AM
That's an
07-23-2012 10:56 AM
Thats it.
Thanks,
Jason
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide