Modifying a REST Resource Configuration File
Procedure
- Select a REST Binding on a reference.
-
In the Properties View, click on the hyperlink of the REST resource configuration file.
This displays the REST Resource Configuration File Editor.
- Specify the Context Root.
- Select the Media Type - Standard JSON or XML. The default is Standard JSON.
-
Click
to add a resource. In the
Details Section, specify the following resource details.
- Resource Name: resource name must be unique.
- Resource Path: Resource Path is the path used to access a resource. It is appended to the value of Context Root.
Note:
The URL is a combination of the following: <machine_name>:<port>/<ContextRoot>/<Resource>.
In TIBCO ActiveMatrix, a WSDL is usually created with operations in it. If a REST service hosts this WSDL, each operation name has a 'Path' (or Resource Path) associated with the operation. The 'Path' may be different from the Operation Name. This 'Path' must be mapped to the corresponding 'Resource' in the REST Resource Configuration file on a reference.
- Path Parameters: To create a path parameter, create a Path variable represented as {path parameter}. For example, Resource path to access a book with Id is "/book/{id}" where {id} is Path Parameter. Path Parameters are added automatically to the table based on the Resource Path value. In the table, you can edit the data type but you cannot add or remove parameters. Path Parameters cannot be null or empty.
-
Click
to add an operation to a resource. In the
Details Section, specify operation details such as
Operation Name and
HTTP Method.
Operation Name must be unique across all resources. You can select
GET,
PUT,
POST, or
DELETE as the
HTTP Method. The default is
GET. For each operation, specify the following request and response details, as appropriate.
-
Click
to add an error type to an operation.
One operation can have multiple error types. Every error type must be associated with either a single or a list of HTTP Status Codes. If a list of status codes needs to be specified, separate them with a comma.
-
To generate a WSDL file from the
.rrc file, select the .rrc file in the Project Explorer window, and then select
Generate WSDL from the shortcut menu.
A WSDL along with XSD (in case of Standard JSON) is generated.
-
Configure the reference using the WSDL generated in step 8.
Note: On the REST reference side, you must use only the WSDL generated from the REST Resource Configuration File Editor to configure the reference. Do not manually edit a WSDL generated from the REST Resource Configuration File Editor. Make sure that the WSDL and the .rrc file are always in sync with each other. That is, if you make changes in the REST Resource Configuration File Editor, always regenerate the WSDL file.
Copyright © 2022. Cloud Software Group, Inc. All Rights Reserved.