Created by: Paulo Silva on 13-04-2012 09:59:28 AM Hello, I am using the following C# code to test the CDRonDemand API, but always get a The remote server returned an error: (500) Internal Server Error. Should mention that the same request code is used for a PerfmonPort call and works like a charm; at this time i am not sure if the problem is with the headers and with the SOAP. Can anybody spot any spot any issue on the code bellow? HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://xxx.xxx.xxx.xxx:8443/CDRonDemandService/services/CDRonDemand"); request.Method = "POST"; request.Headers.Add("Charset", "utf-8"); request.Accept = "application/soap+xml, application/dime, multipart/related, text/*"; request.UserAgent = "PerformanceMonitor"; request.Host = "xxx.xxx.xxx.xxx:8443"; request.Headers.Add("Authorization", "Basic " + Authorization); request.ContentType = "text/xml; charset=utf-8"; request.Headers.Add("SOAPAction", "\"http://schemas.cisco.com/ast/soap/action/#CDRonDemand#get_file_list\""); request.ProtocolVersion = HttpVersion.Version11; sAXLRequest = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; sAXLRequest += "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:tns=\"http://schemas.cisco.com/ast/soap/\" xmlns:types=\"http://schemas.cisco.com/ast/soap/encodedTypes\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">"; sAXLRequest += "<soap:Body soap:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"; sAXLRequest += "<tns:get_file_list>"; sAXLRequest += "<in0 xsi:type=\"xsd:string\">201204121000</in0>"; sAXLRequest += "<in1 xsi:type=\"xsd:string\">201204121050</in1>"; sAXLRequest += "<in2 xsi:type=\"xsd:boolean\">true</in2>"; sAXLRequest += "</tns:get_file_list>"; sAXLRequest += "</soap:Body>"; sAXLRequest += "</soap:Envelope>"; Thanks in advance, Paulo Silva
Subject: RE: SOAP for CDRonDemand Replied by: David Staudt on 20-04-2012 02:52:03 PM Below is a sample request/response (raw) on my 8.5(1) lab setup. Note that HTTP 500 is expected if there is a soap fault, for example if there are no records in the specified range. POST https://10.88.131.141:8443/CDRonDemandService/services/CDRonDemand HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml;charset=UTF-8 SOAPAction: "http://schemas.cisco.com/ast/soap/action/#CDRonDemand#get_file_list" <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap/"> <soapenv:Header/> <soapenv:Body> <soap:get_file_list soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <in0 xsi:type="xsd:string">201204121000</in0> <in1 xsi:type="xsd:string">201204121050</in1> <in2 xsi:type="xsd:boolean">true</in2> </soap:get_file_list> </soapenv:Body> </soapenv:Envelope> ------------------------------- HTTP/1.1 500 Internal Server Error Set-Cookie: JSESSIONIDSSO=6FA9BB7BAA35BA35574DDF8FF78C23E6; Path=/; Secure Set-Cookie: JSESSIONID=EF57E100F7517554487BE8857DBBB53F; Path=/CDRonDemandService; Secure Set-Cookie: SoapSession.id=8557208892656194524 Content-Type: text/xml;charset=utf-8 Transfer-Encoding: chunked Date: Fri, 20 Apr 2012 18:48:50 GMT Connection: close Server: <?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>java.rmi.RemoteException: No file found within the specified time range</faultstring><detail><ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">java.rmi.RemoteException: No file found within the specified time range at com.cisco.ccm.serviceability.soap.cdrondemand.CDRonDemandSoapBindingImpl.get_file_list(Unknown Source) at com.cisco.ccm.serviceability.soap.cdrondemand.CDRonDemandSoapBindingSkeleton.get_file_list(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397) at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186) 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.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 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:525) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567) 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:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Thread.java:619) </ns1:stackTrace><ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">ds-ucm851</ns2:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
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: