« Back to Serviceability XML Questions

LogCollectionPort error

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hi,
I am trying to get logcollection to work, but keep getting this error
 
curl -k -u admin:<snip> -H "Content-type: text/xml;" -H "SOAPAction: http://schemas.cisco.com/ast/soap/action/#LogCollectionPort#SelectLogFiles" -d @req2.xml https://mycucm:8443/logcollectionservice/services/LogCollectionPort
 
content of req2.xml;
--
<?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>
<ns1:SelectLogFiles soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://schemas.cisco.com/ast/soap/">
<FileSelectionCriteria href="#id0"/>
</ns1:SelectLogFiles>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:SchemaFileSelectionCriteria" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://cisco.com/ccm/serviceability/soap/LogCollection/">
<ServiceLogs xsi:type="soapenc:Array" soapenc:arrayType="xsd:string[45]">
<item xsi:type="xsd:string">Cisco AXL Web Service</item>
</ServiceLogs>
<SystemLogs xsi:type="xsd:string" xsi:nil="true"/>
<JobType href="#id2"/>
<SearchStr xsi:type="xsd:string" xsi:nil="true">*</SearchStr>
<Frequency href="#id1"/>
<ToDate xsi:type="xsd:string" xsi:nil="true"/>
<FromDate xsi:type="xsd:string" xsi:nil="true"/>
<TimeZone xsi:type="xsd:string">ClientGMT-8:0)Pacific Standard Time</TimeZone>
<RelText href="#id3"/>
<RelTime xsi:type="xsd:byte">5</RelTime>
<Port xsi:type="xsd:byte">0</Port>
<IPAddress xsi:type="xsd:string">mycucm</IPAddress>
<UserName xsi:type="xsd:string">admin</UserName>
<Password xsi:type="xsd:string">snip</Password>
<ZipInfo xsi:type="xsd:boolean">false</ZipInfo>
</multiRef>
<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:Frequency" xmlns:ns4="http://cisco.com/ccm/serviceability/soap/LogCollection/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">OnDemand</multiRef>
<multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:JobType" xmlns:ns3="http://cisco.com/ccm/serviceability/soap/LogCollection/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">DownloadtoClient</multiRef>
<multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:RelText" xmlns:ns4="http://cisco.com/ccm/serviceability/soap/LogCollection/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">Hours</multiRef>
</soapenv:Body>
</soapenv:Envelope>
--
 
error;
<?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</faultstring><detail><ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">java.rmi.RemoteException
    at com.cisco.ccm.serviceability.soap.LogCollection.LogCollectionBindingImpl.selectLogFiles(Unknown Source)
    at com.cisco.ccm.serviceability.soap.LogCollection.LogCollectionBindingSkeleton.selectLogFiles(Unknown Source)
..
</ns1:stackTrace><ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">mycucm</ns2:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
 
Does anyone have a working example?

Hi!

Here is a working example. I remember it took me a while to figure this out, the samples in the dev guide did not work. This particular call was to a 7.1(5) server, but I've used it towards 8.6 as well.

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:NS2="http://cisco.com/ccm/serviceability/soap/LogCollection/">
<NS1:SelectLogFiles xmlns:NS1="http://schemas.cisco.com/ast/soap/">
<FileSelectionCriteria href="#1"/>
</NS1:SelectLogFiles>
<NS2:SchemaFileSelectionCriteria id="1" xsi:type="NS2:SchemaFileSelectionCriteria">
<ServiceLogs xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]">
<item>Cisco AXL Web Service</item>
</ServiceLogs>
<SystemLogs xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[0]"/>
<SearchStr xsi:type="xsd:string"></SearchStr>
<Frequency xsi:type="NS2:Frequency">OnDemand</Frequency>
<JobType xsi:type="NS2:JobType">DownloadtoClient</JobType>
<TimeZone xsi:type="xsd:string">ClientemoticonCET)Central European Time</TimeZone>
<RelText xsi:type="NS2:RelText">Weeks</RelText>
<RelTime xsi:type="xsd:byte">120</RelTime>
<Port xsi:type="xsd:byte">0</Port>
<IPAddress xsi:type="xsd:string"></IPAddress>
<UserName xsi:type="xsd:string"></UserName>
<Password xsi:type="xsd:string"></Password>
<ZipInfo xsi:type="xsd:boolean">false</ZipInfo>
<RemoteFolder xsi:type="xsd:string"></RemoteFolder>
</NS2:SchemaFileSelectionCriteria>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

And here is working xml to download a file.

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<NS1:GetOneFile xmlns:NS1="http://schemas.cisco.com/ast/soap/">
<FileName xsi:type="xsd:string">/var/log/active/tomcat/logs/axl/log4j/axl00005.log</FileName>
</NS1:GetOneFile>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Kind regards,

//Dan