i tested it in the website
http://www.soapclient.com/soaptest.html
I entered the link of myservice which is http://196.218.16.133/onlinereservation/service.asmx?WSDL
and i go to hotelsearch function and paste in HotelData this XML code
- Code: Select all
<HotelsParameters><CityID>388</CityID><UserName>admin</UserName><UserPassword>admin</UserPassword><DateFrom>12/04/2010</DateFrom><DateTo>13/04/2010</DateTo><NumberOfRooms>2</NumberOfRooms><CurrencyID>162</CurrencyID><Room><RoomSerial>1</RoomSerial><Adults>1</Adults><Child><ChildSerial>1</ChildSerial><ChildAge>5</ChildAge></Child></Room><Room><RoomSerial>2</RoomSerial><Adults>2</Adults><Child><ChildSerial>1</ChildSerial><ChildAge>8</ChildAge></Child><Child><ChildSerial>2</ChildSerial><ChildAge>5</ChildAge></Child></Room></HotelsParameters>
and it produce XML Result
all that i need is to get it using my code, [COLOR="red"]i use var_dump($result)[/COLOR] but it did not produce XML file, it produce string
how to produce XML file using another funtion that var_dump()
MY code is
[PHP]
<?
$dom = new DOMDocument("1.0");
// display document in browser as plain text
// for readability purposes
header("Content-Type: text/plain");
// Call the Cdyne result Service. Debugging mode enabled (e.g. 'trace'=>true)
$client = new SOAPClient('http://196.218.16.133/onlinereservation/service.asmx?WSDL');
try {
$params->HotelData = '<HotelsParameters><CityID>388</CityID><UserName>admin</UserName><UserPassword>admin</UserPassword><DateFrom>12/04/2010</DateFrom><DateTo>13/04/2010</DateTo><NumberOfRooms>2</NumberOfRooms><CurrencyID>162</CurrencyID><Room><RoomSerial>1</RoomSerial><Adults>1</Adults><Child><ChildSerial>1</ChildSerial><ChildAge>5</ChildAge></Child></Room><Room><RoomSerial>2</RoomSerial><Adults>2</Adults><Child><ChildSerial>1</ChildSerial><ChildAge>8</ChildAge></Child><Child><ChildSerial>2</ChildSerial><ChildAge>5</ChildAge></Child></Room></HotelsParameters>'; // set up parameters to pass. If we need multiple
// parameters, we can add additional elements to
// the array: $params->City = 'Dublin'
$result = $client->HotelsSearch($params);
//echo $result;
} catch (SOAPFault $exception) {
// if we hit an error, print the exception and the XML we sent
print $exception;
print htmlspecialchars($client->__getLastRequest());
// exit;
}
var_dump($result);
?>
[/PHP]


