Skip to content

Instantly share code, notes, and snippets.

@ederrafo
Last active September 8, 2015 00:56
Show Gist options
  • Save ederrafo/63237149e8b9e8939f4e to your computer and use it in GitHub Desktop.
Save ederrafo/63237149e8b9e8939f4e to your computer and use it in GitHub Desktop.
/*1*/
$ns = 'http://schemas.tourico.com/webservices/authentication';
$uri = 'http://demo-hotelws.touricoholidays.com/HotelFlow.svc?wsdl';
$options = array('trace' => 1,'use' => SOAP_LITERAL,'soap_version'=>SOAP_1_1,'compression' => SOAP_COMPRESSION_ACCEPT );
$_client = new soapclient($uri,$options);
$headerCredentials = array('LoginName'=>'user','Password'=>'pwd');
$headerCredentials = new SOAPHeader($ns, 'AuthenticationHeader', $headerCredentials);
$_client->__setSoapHeaders($headerCredentials);
$_client->__getFunctions();
$xml = '
<hot:SearchHotelsByDestinationIds
xmlns:hot="http://tourico.com/webservices/hotelv3"
xmlns:hot1="http://schemas.tourico.com/webservices/hotelv3">
<hot:request>
<hot1:DestinationIdsInfo>
<hot1:DestinationIdInfo id="5981"/>
</hot1:DestinationIdsInfo>
<hot1:CheckIn>2015-11-09</hot1:CheckIn>
<hot1:CheckOut>2015-11-10</hot1:CheckOut>
<hot1:RoomsInformation>
<hot1:RoomInfo>
<hot1:AdultNum>1</hot1:AdultNum>
<hot1:ChildNum>0</hot1:ChildNum>
</hot1:RoomInfo>
</hot1:RoomsInformation>
<hot1:MaxPrice>0</hot1:MaxPrice>
<hot1:StarLevel>0</hot1:StarLevel>
<hot1:AvailableOnly>true</hot1:AvailableOnly>
</hot:request>
</hot:SearchHotelsByDestinationIds>';
$body = new \SoapVar($xml, XSD_ANYXML);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment