2011-04-13 76 views
1
$client = new SoapClient(null, array('location' => "http://www.xxx.com/demo/webservice/wsHotel.sh",'uri' => "http://www.xxx.com/demo/", 'encoding' =>"ISO-8859-9")); 

$parm['login'] = "UserName"; 
$parm['pass'] = "Pass"; 
$parm['agency_code'] = "AgencyCode"; 
$parm['letters'] = "Germany"; 
$inf = ($client->__soapCall("destinationListByLetterV2",array($parm)));` 

<?xml version="1.0" encoding="UTF-8"?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
    <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
    <ns1:destinationListByLetterV2 xmlns:ns1="urn:http://www.xxx.com/demo/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
    <params xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:Array" ns2:arrayType="xsd:string[4]"> 
    <item xsi:type="xsd:string">UserName</item> 
    <item xsi:type="xsd:string">Pass</item> 
    <item xsi:type="xsd:string">AgencyCode</item> 
    <item xsi:type="xsd:string">Germany</item> 
    </params> 
    </ns1:destinationListByLetterV2> 
</soap:Body> 
</soap:Envelope> 

缺少参数问题?如何soapclient请求到XML请求?PHP SoapClient的,以XML请求

+0

嗨,你可以更具体一点你的问题? [SoapClient](http://us.php.net/manual/en/class.soapclient.php)将创建一个XML负载,因为这是SOAP的本质。请求被发送到实例化SoapClient时指定的端点。 – quickshiftin 2012-01-31 23:48:40

回答

0
$parm['login'] = "UserName"; 
$parm['pass'] = "Pass"; 
$parm['agency_code'] = "AgencyCode"; 
$parm['letters'] = "Germany"; 

然后,你可以这样调用:

$result = $client->destinationListByLetterV2($parm);