ok I'm trying to connect to a webservice which utilizes the OTA XML schema ("http://www.opentravel.org/OTA/2003/05/GetVehAvailRate")
this webservice is hosted at rentcentric.com, which is a hosted solution for taking reservations and bookings online, the system requires a username and password to connect & so far every attempt at connecting has resulted in a blank white page.
no error messages no PHP output,
Im still fairly new to using SOAP, (although I did have great success when using it on an estate agents site - which didnt require any authentication just a simple value to identify the company on that service)
I have read and tried nearly all the examples found on this site & others with no joy!
the request made to the service is outlined below, each request has a core set of arguments which are:
PickUpDateTime //date
ReturnDateTime //date
PickUpLocation.locationCode //string
ReturnLocation.locationCode //string
PromotionCod //string
the service url http://www2.rentcentric.com/Ota2007a/OTASrvc.asmx has all the methods available to us.
# GetVehAvailRate
# VehCancel
# VehLocSearch
# VehModify
# VehRes
Request -: GetVehAvailRate
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<SRVCredentials xmlns="http://www.opentravel.org/OTA/2003/05">
<Username>*USERNAME*</Username>
<Password>*PASSWORD*</Password>
</SRVCredentials>
</soap:Header>
<soap:Body>
<OTA_VehAvailRateRQ EchoToken="string" TimeStamp="dateTime" Target="Test or Production" Version="decimal" TransactionIdentifier="string" SequenceNmbr="nonNegativeInteger" TransactionStatusCode="Start or End or Rollback or InSeries or Continuation or Subsequent" PrimaryLangID="language" AltLangID="language" RetransmissionIndicator="boolean" ReqRespVersion="string" MaxResponses="positiveInteger" MaxPerVendorInd="boolean" xmlns="http://www.opentravel.org/OTA/2003/05">
<POS>............
code example:
$soapClient = new SoapClient("http://www2.rentcentric.com/Ota2007a/OTASrvc.asmx?wsdl");
// Prepare SoapHeader parameters
$sh_param = array(
'Username'=>'username',
'Password'=>'password');
$headers = new SoapHeader('http://www2.rentcentric.com/Ota2007a/', 'UserCredentials', $sh_param);
// Prepare Soap Client
$soapClient->__setSoapHeaders(array($headers));
Im just bangning my head against the wall trying to get something to return, All I need is pointed in the right direction...
'trace'option mentioned by user470714, you can also enable the'exceptions'option so that "faults" returned by the server are thrown as Exceptions of classSoapFault. Obviously, you should also ensure you have your PHP error reporting configured correctly if you are see a blank output page.