Example: Create a Universal Web Service Destination System (OData)
Use
The following example describes the process for creating a universal Web service destination system. The OData service provided by Microsoft, http://services.odata.org/V3/OData/OData.svc, is used as the example service.
Procedure
Defining Web Service Settings
-
Choose Add Destination System. Then choose the destination system type Universal Web Service Destination System.
-
Enter the name of the destination system and choose OK.
The Web Service Settings tab appears.
-
In the Description Type field, select the option OData.
-
Enter the example service in the Description URI field:
http://services.odata.org/V3/OData/OData.svc.
-
Choose the Explore pushbutton.
All available data and service operations for the selected service are displayed in the Service Explorer screen area.
-
Choose the first node ODataDemo.Advertisement by clicking on this node.
You have now selected the operation Read:ODataDemo.Advertisement. This operation is displayed at the bottom in the Operation field.
-
Press ENTER.
The Operation Configuration tab appears.
Creating the Operation Configuration
-
The following data is displayed for the selected service operation on the Operation Configuration tab:
Field
Data Displayed
Endpoint URL
http://services.odata.org/V3/OData/OData.svc
Operation
Read:ODataDemo.Advertisement
-
Since you have selected the Read:ODataDemo.Advertisement operation of an OData service, the Request Message Configuration tab remains empty because the operation does not need any request parameters. The parameters of the selected operation are displayed automatically for all other operations.
-
Choose the Response Message Configuration tab in the lower screen area. Select the Map HTTP Status checkbox.
The HTTP_STATUS variable is displayed in the list of output variables.
-
A row with the parameter value, the parameter type ODataDemo.Advertisement[], and the Create pushbutton is displayed in the Response Configuration table. Choose the Create pushbutton.
The Array Mapping dialog box appears.
-
Enter the letter i (index variable) in the Array Index field to be able to create an array with a dynamic size. Click OK.
The system displays a new node with the name [i] in the Response Message Configuration table. In addition, the Create pushbutton appears at the end of the row.
-
Choose the Create pushbutton.
The node [i] is expanded and displays the parameters ID, AirDate, and Name. A complex parameter with the name FeaturedProduct is also displayed.
-
Select the row of the field ID and choose
at the bottom of the screen.PCo displays outID[i] in the Variable field. The variable is displayed with an icon
. -
Repeat this for AirDate and Name.
The variables are displayed in the list of output variables.
Test Configuration
-
Choose the Test Configuration pushbutton.
The Test Request dialog box appears. The following tabs are displayed:
-
The Request Variables tab is empty at this point because this Read_all-Operation does not require any request variables.
-
The Response Variables tab contains all variables from the list of variables.
-
The Raw Request and Raw Response tabs already contain values.
-
The message Web service not called is displayed in the status bar of the dialog window.
-
-
Choose the Test pushbutton.
If the test was successful, the message Test OK appears in the status bar.
-
The Value column on the Response Variables tab is filled with the symbol [ ]. This means that more than one value has been read.
If you had selected HTTP_STATUS, the value 200 (HTTP Status OK) is now displayed for this variable:
Example of Response Variables
-
The Raw Request tab now contains the URI and header data that is sent during the request as plaintext:
Example of Raw Request
-
The Raw Response tab contains the response from the server in the form of plaintext. The response text must be a valid JSON object. The response looks like this:
Example of Raw Response
-
-
Close the Test Request dialog box.