User Tools

Site Tools


ors-soap-api:public:setup_guide

Setup guide

Licence

First you need to obtain ORS Licence. Please contact us at support@ors.si

You can also use this DEMO Licence to get you started.

Service URL

Use this service URL for sending reqeusts: http://www.ors.si/orsxml-soap-api/orsxml_soap.php

API Doc

You can check API ducumentation for detailed view of all the classes and methods. Some usage are also described in this manual.

Instructions

Follow this instructions to create a simple soap reqeust using ORS SOAP API. Instructions are for PHP language

SOAP client object

Fisrt you need to create SOAP client object. This is a PHP example of SOAP client object

// init soapClient object
$soapClient = new SoapClient(null, array(
    'location' => 'http://www.ors.si/orsxml-soap-api/orsxml_soap.php',
    'uri'      => 'http://www.ors.si/orsxml-soap-api',
    'trace'    => 1)
);

Header information

Setup your SOAP header information using your ORS licence (you can use DEMO licence if you don't already have a valid ORS licence). Check SOAP Header Information for more information on header parameters.

// ORSXML header information
$header = array(
    'lang'  => 'en',            // a return language
    'usr'   => 'xmldemo',       // ORSXML user
    'pass'  => 'orsdemo',       // ORSXML password
    'agid'  => '5780',          // agency ID (or account id)
    'sid'   => session_id()     // this is required so that filtering and sorting work correctly!
);

SOAP call example

This is an example how to create Regions call to retrieve a list of available regions for selected search parameters.

$searchParams = array(
  'vnd' => '30.10.2014',       // start date
  'bsd' => '15.11.2014',       // end date
  'tdc' => '1-4',              // duration [min-max] days
  'epc' => '2',                // number of adults
);
 
$regions = $soapClient->orsxml_hotel_api_call( 'regions', $searchParams, $header );

Conclusion

That's it! You have now created your first SOAP call. Check all available SOAP Calls that you can execute and SOAP Structure to understand in more detail how all works.

ors-soap-api/public/setup_guide.txt · Last modified: 2015/01/24 16:40 (external edit)