//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;
?>
It is showing Internal Server error
Later on i have changed above xml into array using xml2array class and i kept the result in one variable like
$iArray=xml2array($xmlData);
Using this i have coded like:
<?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;
?>
It is showing Invalid Xml error
Hi I was getting same kind of error but then @Pete here , helped me with this code snippet , please try to use this code snippet may be it can work for you as well..