how to call the function and send the xml request to soap using php



I am unable to send the xml request data to the soap Function.It returns **SoapFault exception: [S:Server] java.lang.NullPointerException in **. when i call the __getFunctions() method it returns



array(1) { [0]=> string(42) "fundResponse process(fundRequest $request)" }


My SoapClient Calling code is like this



$xml='<?xml version="1.0" encoding="UTF-8"?>
<FundGate>
<direction>request</direction>
<action>FT</action>
<terminalId>'.$terminalid.'</terminalId>
<transaction>
<pin>'.$password.'</pin>
<bankCode>'.$bankcode.'</bankCode>
<amount>'.$amount.'</amount>
<destination>'.$destination.'</destination>
<reference>'.$reference.'</reference>
<endPoint>A</endPoint>
</transaction>
</FundGate>';
$client=new SoapClient($url);

try {

$response=$client->process("fundRequest",$xml);
print_r($response);
}
catch(SoapFault $e)
{
echo $e;

}


Here transaction is object. I am unable to get the Response. and my wsdl code like this



<portType name="FundGate">
<operation name="process">
<input wsam:Action="http://xxxxxx/processRequest" message="tns:process"/>
<output wsam:Action="http://xxxxxx/processResponse" message="tns:processResponse"/>
</operation>
</portType>
<xs:complexType name="fundRequest">
<xs:sequence>
<xs:element name="direction" type="xs:string" minOccurs="0"/>
<xs:element name="action" type="xs:string"/>
<xs:element name="id" type="xs:string"/>
<xs:element name="terminalId" type="xs:string" minOccurs="0"/>
<xs:element name="terminalCard" type="xs:string" minOccurs="0"/>
<xs:element name="transaction" type="tns:transaction"/>
</xs:sequence>
</xs:complexType>


when i call the __getLastRequest() it returns NULL. i am unable to get the result. Please help me. how to send the xml request to the soapfunction. thanks in advance


No comments:

Post a Comment