03-08-2017 10:28 PM - edited 03-13-2019 09:48 PM
All,
I feel that I am really close, but I am not able to retrieve a phone's status via the selectCmDevice Operation of the RisPort SOAP Service.
Here is my perl Code:
#!/usr/bin/perl
my $cucm_ip = "10.74.13.228";
my $user_axl = "user";
my $password_axl = "password";
my $dev ="SEPE8BA70FB8CB5";
###############################################################################################
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
use SOAP::Lite;
BEGIN
{
sub SOAP::Transport::HTTP::Client::get_basic_credentials
{
return
($user_axl => $password_axl)
}
}
my $CUCM = SOAP::Lite
->uri("http://schemas.cisco.com/ast/soap/action/#RisPort#selectCmDevice") #->uri("http://schemas.cisco.com/ast/soap/")
->proxy("https://$cucm_ip:8443/realtimeservice/services/RisPort"); ###Maybe ?wsdl");
#->proxy("loopback://");
$CUCM->outputxml(1);
$CUCM->readable(1);
#$CUCM->envprefix('soapenv');
#$CUCM->ns($uri,'soap');
$CUCM->autotype(0);
print "The Device $dev\n\n\n";
#####i#############################################################################################
my %select =(
"MaxReturnedDevices" => 200,
"DeviceClass" => "Any",
"Model" => 255,
"Status" => 'Any',
"NodeName" => '',
"SelectBy" => 'Name',
"SelectItems" => "<item><Item>$dev</Item></item>",
"Protocol" => 'Any',
"DownloadStatus" => 'Any' );
#################################################################
my $state = SOAP::Data->name('StateInfo','');
my $data = SOAP::Data->name('CmSelectionCriteria' , => \%select);
my $elem = SOAP::Data->type('data' => $data);
my $response = $CUCM->selectCmDevice($state,$elem);
##my $status=$response->valueof('//return/row/Status');
##print "status is : $status\n\n";
open OUT,'>','soap.xml' or die "$!";
print OUT $response;
close OUT;
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>org.xml.sax.SAXException: Invalid element in com.cisco.ccm.serviceability.soap.risport.CmSelectionCriteria - DeviceClass</faultstring><detail><ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">org.xml.sax.SAXException: Invalid element in com.cisco.ccm.serviceability.soap.risport.CmSelectionCriteria - DeviceClass
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:81)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at sun.reflect.GeneratedMethodAccessor195.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:301)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:394)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Something tells me that the error may be around the <SelectItems> tag because I am not sure that the child structure is adequate. I am also unsure that the URI, and proxy were constructed properly, lastly, I know that a sequence # is needed, I am unsure of how to include that as part of the request.
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