I am trying to integrate web services using soap.
This is the xml file:
http://uatapiout.islandhopper.in/Service1.svc?wsdl
And this is code which I am trying:
<?php
$wsdl = 'http://uatapiout.islandhopper.in/Service1.svc?wsdl';
$xml_array["RequestType"] = "AvailabilityRQ";
$xml_array["Login"] = array("UserName"=>"test","Password"=>"test","Version"=>"3.0");
$xml_array["CheckAvailabilityCriteria"] = array("CheckIn" => "07/05/2017","CheckOut"=> "07/11/2017","CountryID"=> "MAU","CityID" => "MAU","Currency" => "USD","Adult" => "2","Rooms"=>array("Room"=>array("Adult"=>"2","Child"=>"0")));
$trace = true;
$exceptions = true;
try
{
$client = new SoapClient($wsdl, array('trace' => 1));
$response = $client->HotelSearch($xml_array );
print_r($client->__getLastRequest());
print_r($client->__getLastResponse());
}
catch (Exception $e)
{
echo "Error!";
echo $e ->getMessage ();
echo 'Last response: '. $client->__getLastResponse();
}
And $client->__getLastRequest() always gives me blank body:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/"><SOAP-ENV:Body><ns1:HotelSearch/></SOAP-ENV:Body></SOAP-ENV:Envelope>
So, the question is that why this request has a blank body.
Please suggest me, what am I doing wrong?
Thanks in advance.
Edit:
This is sample xml request:
<XMLRequest>
<RequestType>AvailabilityRQ</RequestType>
<Login>
<UserName>UserName</UserName>
<Password>Password</Password>
<Version>3.0</Version>
</Login>
<CheckAvailabilityCriteria>
<CheckIn>07/05/2016</CheckIn>
<CheckOut>07/11/2016</CheckOut>
<CountryID>MAU</CountryID>
<CityID>MAU</CityID>
<Currency>USD</Currency>
<HotelCode></HotelCode>
<HotelName></HotelName>
<ClientNationality></ClientNationality>
<Rooms>
<Room>
<Adult>2</Adult>
<Child>2</Child>
<ChildAges>
<ChildAge>7</ChildAge>
<ChildAge>14</ChildAge>
</ChildAges>
</Room>
<Room>
<Adult>2</Adult>
<Child>0</Child>
</Room>
</Rooms>
</CheckAvailabilityCriteria>
</XMLRequest>