0
//PHP CODE
<?php
$xmlData='<OTA_HotelDestinationsRQ Version="1.0">
<POS>
<Source>
<UniqueId Id="user:password" />
</Source>
</POS>
<DestinationInformation LanguageCode="EN" />
</OTA_HotelDestinationsRQ>';
$wsdl="http://acceptance.travelstreet.com/hotelsv3/components/Hotels_DestinationsWS.cfc?wsdl";
$client=new SoapClient($wsdl,array('trace' => 1));
try
{
$res=$client->__call("OTA_HotelDestinationsRQ",array($xmlData));
}
catch (SoapFault $Exception)
{
echo 'SoapFault Exception';
}
echo $res;
?>
它表示SOAP请求不工作
后来内部服务器错误上我已经上面的XML使用xml2array类改变为阵列和我不停的结果在一个可变像
$iArray=xml2array($xmlData);
使用这种我已经编码等:
<?php
$xmlData='<OTA_HotelDestinationsRQ Version="1.0">
<POS>
<Source>
<UniqueId Id="user:password" />
</Source>
</POS>
<DestinationInformation LanguageCode="EN" />
</OTA_HotelDestinationsRQ>';
$wsdl="http://acceptance.travelstreet.com/hotelsv3/components/Hotels_DestinationsWS.cfc?wsdl";
$client=new SoapClient($wsdl,array('trace' => 1));
try
{
$res=$client->__call("OTA_HotelDestinationsRQ",$iArray);
// (or) also check with bellow statement
$res=$client->OTA_HotelDestinationsRQ($iArray);
}
catch (SoapFault $Exception)
{
echo 'SoapFault Exception';
}
echo $res;
?>
它表示无效的Xml错误
在什么地方错误发生? '__call'已被弃用,你不应该使用'__soapCall'?你对“OTA_HotelDestinationsRQ”的论点是否正确?从WSDL我会期望'argRequest'和'argApplicationName'(作为'OTA_HotelDestinationsRQRequest'的一部分)? – Jorik
显示无效的XML错误的肥皂响应。如果我们将上面的xml请求更改为数组,可能我会工作 – Hearaman