Ping Request
OTA Message Pair: OTA_PingRQ / OTA_PingRS
The OTA_PingRQ message may be used for testing application connectivity, sending some specific text and determining if the receiving application is able to echo back that same text.
The message is usually the first message to be completed in the development process since it is the most simple to implement compared to the other messages.
When a client application sends a correctly-formatted OTA_PingRQ message Levart will respond with an OTA_PingRS message.
The EchoData element is required to be set with some data to be returned in the response.
We have provided a PHP sample below to assist with the development of this message.
This is an ideal message to develop first as it enables fast confirmation whether the transport mechanism is functioning correctly.
Direction
- 3rd Party can send request to Levart and expect a response.
- Levart can send request to 3rd Party and expect a response.
Request OTA_PingRQ
<OTA_PingRQ xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 https://secure.levartdistributionsystems.com.au/html/schema/OTA/2015B/OTA_PingRQ.xsd"
TimeStamp="2020-06-19T22:21:23+08:00" Target="Production" Version="1.0" EchoToken="sdfdsfg8sc">
<EchoData>796b8853-6143-e3e9-9be5-00004513e0fb</EchoData>
</OTA_PingRQ>
Specification OTA_PingRQ
Element | Num | Description |
---|---|---|
OTA_PingRQ | 1 | Root element |
@Version | 1 | Current Version 1.0 |
@EchoToken | 0..1 | Echo Token (Random String) |
@TimeStamp | 1 | Date and time of the transaction in ISO 8601 format. e.g. 2016-01-28T15:15:00+08:00 |
EchoData | 1 | EchoData element, contains the contents of the string in the EchoData request |
Response (Success)
<OTA_PingRS xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 https://secure.levartdistributionsystems.com.au/html/schema/OTA/2015B/OTA_PingRS.xsd"
TimeStamp="2020-06-19T22:21:23+08:00" Target="Production" Version="1.0" EchoToken="sdfdsfg8sc">
<Success />
<EchoData>796b8853-6143-e3e9-9be5-00004513e0fb</EchoData>
</OTA_PingRS>
Response (Error)
<OTA_PingRS xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 https://secure.levartdistributionsystems.com.au/html/schema/OTA/2015B/OTA_PingRS.xsd"
TimeStamp="2020-06-19T22:21:23+08:00" Target="Production" Version="1.0" EchoToken="sdfdsfg8sc">
<Errors>
<Error Type="1">No EchoData provided</Error>
</Errors>
</OTA_PingRS>
Specification OTA_PingRS
Element | Num | Description |
---|---|---|
OTA_PingRS | 1 | Root element |
@Version | 1 | Current Version 1.0 |
@EchoToken | 0..1 | Echo Token Response (Same string as in request) |
@TimeStamp | 1 | Date and time of the transaction in ISO 8601 format. e.g. 2016-01-28T15:15:00+08:00 |
Success | 0..1 | Element exists if request read and validated successfully. |
Errors / Error | 0..n | Errors in the request |
EchoData | 1 | The echo reply data. |
Sample PHP SOAP Client
Below is a sample PHP 5+ implementation using the inbuilt SoapClient class.
$options = array(
'login' => 'USERNAME-HERE',
'password' => 'PASSWORD-HERE'
);
$client = new SoapClient("https://secure.levartdistributionsystems.com.au/servers/changeme.html?WSDL", $options);
$pingRq = new stdClass();
$pingRq->EchoData = 'abc234234324';
$response = $client->PingRQ($pingRq);
var_dump($response);