phpsoapcucmcisco-axl

Writing a SOAP function in php


I have a soap function called get_file_list that I would like to write for PHP however I can not get it to work. It has three parameters, 1) start time, 2) end time, and 3) boolean. This is what the sample code looks like in soap;

<?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:get_file_list soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://schemas.cisco.com/ast/soap/">
<in0 xsi:type="xsd:string">200511161000</in0>
<in1 xsi:type="xsd:string">200511161059</in1>
<in2 href="#id0"/>
</ns1:get_file_list>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:boolean"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">true</multiRef>
</soapenv:Body>
</soapenv:Envelope>

I've written the PHP like this;

$response = $soapClient->__get_file_list(array('$in0'=>'201401161000','$in1'=>'201401161059','$in2'=>'id0'));
print_r($response);

I know that I am definitely authenticating and that get_file_list is a true soap function because I am able to generate this output;

Array
(
    [0] => ArrayOfFileName get_file_list(string $in0, string $in1, boolean $in2)
    [1] => void get_file(string $in0, string $in1, string $in2, string $in3, string $in4, boolean $in5)
)

When I execute the page, it returns a blank. Any help is appreciated.

Here is the wsdl

<wsdl:definitions targetNamespace="http://schemas.cisco.com/ast/soap/"><!--WSDL created by Apache Axis version: 1.4 With AXIS-2250
Built on Apr 22, 2006 (06:55:48 PDT)--><wsdl:types><schema targetNamespace="http://schemas.cisco.com/ast/soap/"><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType name="ArrayOfFileName"><sequence><element maxOccurs="unbounded" minOccurs="0" name="FileName" nillable="true" type="xsd:string"/></sequence></complexType></schema></wsdl:types><wsdl:message name="get_file_listRequest"><wsdl:part name="in0" type="xsd:string"/><wsdl:part name="in1" type="xsd:string"/><wsdl:part name="in2" type="xsd:boolean"/></wsdl:message><wsdl:message name="get_fileResponse">

   </wsdl:message><wsdl:message name="get_fileRequest"><wsdl:part name="in0" type="xsd:string"/><wsdl:part name="in1" type="xsd:string"/><wsdl:part name="in2" type="xsd:string"/><wsdl:part name="in3" type="xsd:string"/><wsdl:part name="in4" type="xsd:string"/><wsdl:part name="in5" type="xsd:boolean"/></wsdl:message><wsdl:message name="get_file_listResponse"><wsdl:part name="get_file_listReturn" type="impl:ArrayOfFileName"/></wsdl:message><wsdl:portType name="CDRonDemand"><wsdl:operation name="get_file_list" parameterOrder="in0 in1 in2"><wsdl:input message="impl:get_file_listRequest" name="get_file_listRequest"/><wsdl:output message="impl:get_file_listResponse" name="get_file_listResponse"/></wsdl:operation><wsdl:operation name="get_file" parameterOrder="in0 in1 in2 in3 in4 in5"><wsdl:input message="impl:get_fileRequest" name="get_fileRequest"/><wsdl:output message="impl:get_fileResponse" name="get_fileResponse"/></wsdl:operation></wsdl:portType><wsdl:binding name="CDRonDemandSoapBinding" type="impl:CDRonDemand"><wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation name="get_file_list"><wsdlsoap:operation soapAction="http://schemas.cisco.com/ast/soap/action/#CDRonDemand#get_file_list"/><wsdl:input name="get_file_listRequest"><wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://schemas.cisco.com/ast/soap/" use="encoded"/></wsdl:input><wsdl:output name="get_file_listResponse"><wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://schemas.cisco.com/ast/soap/" use="encoded"/></wsdl:output></wsdl:operation><wsdl:operation name="get_file"><wsdlsoap:operation soapAction="http://schemas.cisco.com/ast/soap/action/#CDRonDemand#get_file"/><wsdl:input name="get_fileRequest"><wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:CDRonDemand" use="encoded"/></wsdl:input><wsdl:output name="get_fileResponse"><wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://schemas.cisco.com/ast/soap/" use="encoded"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service name="CDRonDemandService"><wsdl:port binding="impl:CDRonDemandSoapBinding" name="CDRonDemand"><wsdlsoap:address location="https://<server_ip>:8443/CDRonDemandService/services/CDRonDemand"/></wsdl:port></wsdl:service></wsdl:definitions>

Solution

  • The format is actually $soapClient->get_file_list('201401271000','201401271059','id0').