This shows you the differences between two versions of the page.
ors-soap-api:public:setup_guide [2015/01/24 16:40] |
ors-soap-api:public:setup_guide [2015/01/24 16:40] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== 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 [[http://ors.si/orsxml-soap-api/docs/apigen/index.html|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 | ||
+ | |||
+ | <code php> | ||
+ | // 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) | ||
+ | ); | ||
+ | </code> | ||
+ | |||
+ | ==== Header information ==== | ||
+ | |||
+ | Setup your SOAP header information using your ORS licence (you can use [[demo_licence|DEMO licence]] if you don't already have a valid ORS licence). Check [[SOAP Header]] for more information on header parameters. | ||
+ | |||
+ | <code php> | ||
+ | // 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! | ||
+ | ); | ||
+ | </code> | ||
+ | |||
+ | ==== SOAP call example ==== | ||
+ | |||
+ | This is an example how to create [[regions|Regions call]] to retrieve a list of available regions for selected [[soap_structure#search_parameters|search parameters]]. | ||
+ | |||
+ | |||
+ | <code php> | ||
+ | $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 ); | ||
+ | </code> | ||
+ | |||
+ | ==== 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. |