Show/Hide Toolbars

How to set up Purchase Pre-requisites

Request definition

Set up the request definition according the requirements of the provider. Use the variables to insert purchase data when creating the request during a purchase. The available values are listed next to the Post Format box and are also explained in the Specification of SOA service request and response appendix.

Figure 5, Create a Service Provider - step 2 - REST Request definition

Figure 5, Create a Service Provider - step 2 - REST Request definition

Mandatory field

Attribute

Explanation

Request Definition

Man.

Path

Path to the SOA service.

Man.

Web Service Type

Type of web service, REST or SOAP.

Opt.

Http Request Method

POST

PUT

GET

Opt.

Request Content Type

Set the content type. If left empty, the content type “application/x-www-form-urlencoded” is used for REST.

NOTE: When using this field, the value MUST start with a leading space!

Man.

Service Request Type

JSON

XML

Opt.

Decimal Separator

Decimal separator to be used in the request.

Man.

Post Format

Post format for the request. See Specification of SOA service request and response.

The Post Format shall have a format that match the Service Request Type

The {nn} variables will be replaced with data from the database when sending the request. The meaning of each variable is explained next to the Post Format box

Note:
You can add fixed values to the request, either in a separate fields or as fixed values to the variables. See the example where e.g. the tagId is set to 0.
 
Examples are available in Request and Response examples

Response definition

The Response definition translates the incoming response to WebOffice variables.

All fields below are described in detail in Specification of SOA service request and response

Note:
Each attribute in the response will be analysed in WebOffice.
- If the Rate ID is available this will be used and the amount and date attributes will be ignored.
- If the Rate Amount attribute is set but not the Rate ID then this and the dates will be used to calculate values that a CWT needs to print a ticket and WebOffice needs to store a purchase.
- If both the Rate ID and the Rate Amount are empty an exception will be generated and saved in the Service Statistics page.

Available formats

The response can be sent in 3 formats:

Figure 6, Create a Service Provider - step 3 - REST Response definition. Select service Response Type

Figure 6, Create a Service Provider - step 3 - REST Response definition. Select service Response Type

After selecting an option, the section will refresh with additional fields.

 

XML definition

Example of a Response Definition in XML format

Figure 7, Create a Service Provider - step 3 - REST Response definition XML Example

Figure 7, Create a Service Provider - step 3 - REST Response definition XML Example

All fields are described in detail in Specification of SOA service request and response

To retrieve e.g. the Response Rate ID attribute from the example above, write //*[local-name()='TariffID'] in the field next to it. The string //*[local-name='***'] represents a function that will try to find an XML element with the name *** in the response.

You must use single quotation marks around the field.

Fields that are available in the response but are not mapped to any of the fields available in the definition are ignored. even if the field name exists. E.g., if the response contains a field that matches the field "Response Rate Amount Attribute" in the example above it will be ignored as it is not mapped.

Important:
The exact names in the response depend on the service provider.

See also the Request and Response examples.

 

JSON definition

Example of a Response Definition in JSON format

Figure 8, Create a Service Provider - step 3 - REST Response definition JSON Example

Figure 8, Create a Service Provider - step 3 - REST Response definition JSON Example

All fields below are described in detail in Specification of SOA service request and response.

Write the name of field to retrieve from the response in the corresponding definition field.

Fields that are available in the response but are not mapped to any of the fields available in the definition are ignored.

See also the Request and Response examples.

 

HTTP Status Code

Example of a Response Definition in HTTP format

Figure 9, Create a Service Provider - step 3 - REST Response definition HTTP Example

Figure 9, Create a Service Provider - step 3 - REST Response definition HTTP Example

This definition template is currently not in use.