//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;
?>
Это показывает внутреннюю ошибку сервера
Позже я изменил выше 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;
?>
Это показывает Invalid Xml error