php soapclient到xml请求

时间:2011-04-13 10:42:18

标签: php xml xsd request soap-client

$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请求?

1 个答案:

答案 0 :(得分:0)

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

然后你可以这样称呼它:

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