Creating REST Web Service Components
To create REST web service based component:
1. Login to the application.
2. Navigate to the Components menu.
3. In the left pane, navigate to the module where the new component needs to be added.
4. Right-click the component and select Create Component.
5. On the Create Component page, select the component type as REST SERVICE.
6. Fill in the required fields and click Save.
7. Click Attach Code to save the component and edit it.
 
This section focuses on the following:
Creating a REST Service Component Definition
A component consists of several component definition lines. Each component definition line comprises a keyword, object, display name, attribute values, default data, function name, and output parameters.
The following list describes each entity in a component definition:
Keyword: The step to be performed.
For example: RS-SETREQUESTHEADER, RS-SETENDPOING, RS-PROCESSREQUEST, etc
Object: The Oracle Utilities Testing Accelerator function library name from where the function is called.
Display Name: Component definition
Attribute Values: The web service XML tag name used as variable to store its value.
Default Data: The default data used in the component definition.
Function Name: The function name called from the library.
Output Parameters: The output in the form of a variable.
For more options, refer to Appendix E: Generating Re-runnable Test Data.
Tooltip: The data presented as a tool tip during the flow creation.
The following figure shows the Component page with the available component definitions.
Add the required component definition lines using the Keyword drop-down list to define the REST web service based component.
For a list of keywords used to define the REST web service based components, refer to Appendix C: REST Component Keywords.
The following example shows different component lines that can be created.
1. Select SETAPPTYPE in the Keyword drop-down list to define the application type.
2. Select RS in the Object drop-down list to denote that it is a web services based component.
3. Select the WS-LOGMESSAGE keyword to log comments in component definition. This helps in debugging the script code for that component.
4. Select RS-SETREQUESTHEADER keyword to specify any headers that need to be passed to the REST end point.
5. Select RS-SETMETHOD keyword to specify whether the REST end point needs to be invoked using a GET/POST call.
6. Select RS-PROCESSRESTREQUEST keyword to specify processing of the response from the REST end point.
7. Add more component definition lines as needed and select appropriate keywords based on the REST web service that the component represents.
8. Click Save.
Entering Test Data for a REST Component
To enter test data for a REST component:
1. Navigate to the Flows menu.
2. On the left pane, right-click the flow and select Create/Update Flow Structure.
3. On the Flow Definition page, right-click the REST component and select Edit Test Data.
4. Add any pre-validation and post-validation functions by specifying the library and function details in the Pre Validations and Post Validations tabs.
The REST request body can be any of the following:
Form Data: Key pair values
RAW Data: Raw text that would be sent out as body
Binary: Attach a file that contains the request that would be sent as request to REST end point