4

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...

1
  • Your sample code does not show you attempting to perform any actual calls to the service, or output the result. As well as the 'trace' option mentioned by user470714, you can also enable the 'exceptions' option so that "faults" returned by the server are thrown as Exceptions of class SoapFault. Obviously, you should also ensure you have your PHP error reporting configured correctly if you are see a blank output page. Commented Jul 25, 2013 at 22:18

2 Answers 2

2

Look at the documentation here:

http://www.php.net/manual/en/soapclient.soapclient.php

to see how to add the trace variable to your SoapClient constructor. Once you've done that you can use

  • SoapClient::__getLastRequestHeaders
  • SoapClient::__getLastRequest
  • SoapClient::__getLastResponse
  • SoapClient::__getLastResponseHeaders

As a means to, at the very least, get some feedback as to why your calls are failing.

Sign up to request clarification or add additional context in comments.

Comments

0

You can try using another soap implementation and see if the problem persists. I suggest you Zend Soap

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.