Hi all
I have asked to develop a system using PHP SOAP extension, in order to acquire a web service. WSDL of the web service is shown below:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://test.site.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://test.site.com" xmlns:intf="http://test.site.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><wsdl:types><schema targetNamespace="http://test.site.com" xmlns="http://www.w3.org/2001/XMLSchema"><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType name="XYZParameter"><sequence><element name="key" nillable="true" type="xsd:string"/><element name="value" nillable="true" type="xsd:string"/></sequence></complexType><complexType name="XYZParameters"><sequence><element maxOccurs="unbounded" minOccurs="0" name="Parameter" nillable="true" type="impl:XYZParameter"/></sequence></complexType><complexType name="XYZRequestType"><sequence><element name="RequestMessage" nillable="true" type="xsd:string"/><element name="ClientID" nillable="true" type="xsd:string"/><element name="Password" nillable="true" type="xsd:string"/><element maxOccurs="1" minOccurs="0" name="Parameters" nillable="true" type="impl:XYZParameters"/></sequence></complexType><simpleType name="CommandStatusType"><restriction base="xsd:string"><enumeration value="OK"/><enumeration value="SYSTEM-ERROR"/><enumeration value="SYNTAX-ERROR"/><enumeration value="INVALID"/><enumeration value="ERROR"/></restriction></simpleType><complexType name="XYZResponseType"><sequence><element maxOccurs="1" minOccurs="0" name="TransactionID" nillable="true" type="xsd:string"/><element name="OrigResponseMessage" nillable="true" type="xsd:string"/><element maxOccurs="1" minOccurs="0" name="TermResponseMessage" nillable="true" type="xsd:string"/><element name="CommandStatus" nillable="true" type="impl:CommandStatusType"/><element name="ResultCode" type="xsd:int"/><element maxOccurs="1" minOccurs="0" name="ErrorMsg" nillable="true" type="xsd:string"/></sequence></complexType></schema></wsdl:types>
<wsdl:message name="processRequestRequest">
<wsdl:part name="XYZRequest" type="impl:XYZRequestType"/>
</wsdl:message>
<wsdl:message name="processRequestResponse">
<wsdl:part name="XYZResponse" type="impl:XYZResponseType"/>
</wsdl:message>
<wsdl:portType name="XYZ_Type">
<wsdl:operation name="processRequest" parameterOrder="XYZRequest">
<wsdl:input message="impl:processRequestRequest" name="processRequestRequest"/>
<wsdl:output message="impl:processRequestResponse" name="processRequestResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="XYZCoreSoapBinding" type="impl:XYZ_Type">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="processRequest">
<wsdlsoap:operation soapAction="capeconnect:XYZ_WebService:XYZ_Type#processRequest"/>
<wsdl:input name="processRequestRequest">
<wsdlsoap:body namespace="http://test.site.com" use="literal"/>
</wsdl:input>
<wsdl:output name="processRequestResponse">
<wsdlsoap:body namespace="http://test.site.com" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="XYZ_WebService">
<wsdl:port binding="impl:XYZCoreSoapBinding" name="XYZCore">
<wsdlsoap:address location="https://1.2.3.4:8040/xyz_banks/services/XYZCore"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
My piece of code is:
$client = new SoapClient("https://1.2.3.4:8040/xyz_banks/services/XYZCore?wsdl", array('local_cert'=>"/cert.pem", 'trace' => 1, 'xmlns:eref' => "test.site.com"));
$vars = array();
$vars["RequestMessage"] = "some_message";
$vars["ClientID"] = NULL;
$vars["Password"] = NULL;
$vars["Parameters"]["parameter"][ = array("key" => "key1", "value" => "value1");
$vars["Parameters"]["parameter"][ = array("key" => "key2", "value" => "value2");
$vars["Parameters"]["parameter"][ = array("key" => "key3", "value" => "value3");
$vars["Parameters"]["parameter"][ = array("key" => "key4", "value" => "value4");
$a = $client->__soapCall("processRequest", $vars);
As you can see, they need to provide a client certificate in order to communicate with the server (which is not my issue here - connection establishes successfully).
The above code when runs, produces the following error code:
Fatal error: Uncaught SoapFault exception: [soapenv:Server.userException] org.xml.sax.SAXException: operation description is missing parameter description! in /web/test.php:119 Stack trace: #0 /web/test.php(119): SoapClient->__soapCall('processRequest', Array) #1 {main} thrown in /web/test.php on line ...
Where is the problem? How can I get rid of that?