Defining Message Instances for REST Service Operations
You specify messages for service operations in the Message Information section of the Service Operations – General page.
The messages that you specify define the structure of the data that is contained in the service operation.
The REST method type determines the number of messages and message types (request or response) that you specify. The possible request and response message combinations by REST method type are described elsewhere in this topic.
To specify messages for a REST service operation:
-
Locate the Message Information section on the Service Operations – General page.
-
Locate the Type field, and take note of the message type to define.
-
In the Message.Version field, enter the message name followed by a dot and version, or click the Lookup button to search for a message.
After you select the message, you can click the View Message link to view the message.
-
From the Content-Type drop-down list, select the MIME content type for the message. The valid values are:
-
application/json
-
application/xml
-
text/xml
-
text/plain
-
text/html
-
-
(Optional) Define optional content-types.
To define optional content-types:
-
Click the Optional Content-Types link.
The Set Content Type page appears.
-
Type in any content type or select a content type from the Content-Type drop-down list.
The valid values from the Content-Type drop-down list are the same as those listed in Step 4.
-
To add additional content-types, click the Add Row button (+) and type in a content type or select a content-type from the list.
-
Click the OK button.
The Service Operations – General page appears.
-
-
From the Status Code drop-down list, select the HTTP response code to return to the integration partner.
Note that the content-type defines the acceptable HTTP media type.
The valid HTTP status code values are:
-
200 - Default.
-
201 - This value is valid only when the REST method is Post.
-
202
-
203 - This value is valid only when the REST method is Get.
-
204
-
205
-
206
-
207
-
-
(Optional) Define optional status codes.
You can defined optional status codes on response messages only.
To define optional status codes:
-
Click the Optional Status Codes link.
The Set Status Codes page appears.
-
From the Status Code drop-down list, select a status code.
The valid values are the same as those listed in Step 6.
-
To add additional status codes, click the Add Row button (+) and select a status code from the list.
-
Click the OK button.
The Service Operations – General page appears.
-
-
Repeat steps 1 through 7 for each message type that appears in the Message Information section.
-
Click the Save button.