Representational State Transfer (RESTful) has gained widespread acceptance across the Web as a simpler alternative to SOAP - and Web Services Description Language (WSDL) - based Web servicesServices. RESTful web service Web Service uses architectures architecture that use HTTP or similar protocols by restricting the interface to use standard operations like GET, POST, PUT, DELETE for HTTP. You can create Consumer/Provider activities with the RESTful Web Service Services using Adeptia SuitSuite.
...
Following are the major subsections:
Section Name | Description |
---|---|
This section explains the process of creating web service consumer activity for RESTful Web Service.
Steps to create Web Service Consumer activity for RESTful Web Service
- On the create Web Service Consumer page, select the REST radio button (see Figure 355).
...
| You need to pass the request in the URL. |
...
| You can dynamically override a complete URL or any parameter of the URL with the value of any variable. To do this you need define the variable name in the URL field. |
...
| If you want to pass parameters as a part of HTTP request then, you need to select Header in the Style drop-down list. |
...
- Get
- Put
- Post
- Delete
- Define the Type and Media Type from the Presentation table as per you requirement.
- Select a security policy from the Security Policy drop-down list.
- To know how to create Security policy, please refer to the Creating Security Policy for Web Service section.
- To know how to create Security policy, please refer to the Creating Security Policy for Web Service section.
...
| When you use either Put or Post method, then following two additional options are displayed. |
...
- Expand the Advanced Properties section to view the advance property of the RESTful web service consumer activity (see Figure 357).
...
- If you do not want your RESTful web service consumer activity to wait indefinitely for a response from a web service provider then, enter a timeout value in the Read Timeout (in seconds) text box. The default value is 0 which means your RESTful web service consumer activity will wait indefinitely for a response.
- If you want to enter a time within which your RESTful web service consumer activity should connect to a web service then, enter a timeout value in the Connect Timeout (in seconds) text box. The default value is 0 which means your RESTful web service consumer activity will wait indefinitely for a connection.
- Click the Save button.
...
We can override the REST URL at run time by placing Put-Context-Var before Web Services REST Consumer Activity in the Process Flow.
Steps to override the REST URL:
...
| To know how to create RESTful Consumer, please refer to the [ Creating Web Service Consumer Activity to Access RESTful Web Service | Using RESTful Web Service#_Creating_Web_Service_10] section. |
...
| To know how to create a Target Activity, please refer to the Creating Target Activity section. |
...
Server Entities | Description |
|
---|---|---|
Context Variable |
| Put-Context-Var |
Consumer Activity |
| REST |
Target Activity |
| Any |
...
- Click the Add Variable ( ) to add new context variable. The Context Variable Information screen is displayed.
- Select the Rest Consumer activity (which is to be overridden) from the dropdown list Activity Name. All variables of this Rest Consumer activity are listed in the dropdown list Variable Name (seeFigure 361).
...
- Select restURL variable from the dropdown list Variable Name.
- Enter the Url that you want to override during the run time, in the textbox Variable Value.
- Click Done to close the Context Variable Information screen. This takes the control back to the screen Edit Context Variables. The newly created variable is added to the list of existing context variables.
- Click Done to close the Edit Context Variables screen and return to Process Designer.
- Select your Target activity.
- Save the process flow and exit from Process Designer.
- Execute the process flow, this overrides the dummy URL provided at the design time.
...
...
- Provide the whole RESTful URL in the Variable value text box. For e.g.: http://developer.yahooapis.com/TimeService/V1gettime?appid=YahooDemo
- Provide some parts of RESTful URL in the Variable value text box. For e.g.: http://developer.yahooapis.com/$$Var1$$/V1/gettime?$$Param$$=$$Value$$
Where values of Context Variables Var1, Param, and Value are defined as TimeService, appid and YahooDemo in the Process Flow Designer respectively.
- Provide the whole RESTful URL in the Variable value text box. For e.g.: http://developer.yahooapis.com/TimeService/V1gettime?appid=YahooDemo
...
Step-by-step instructions to create Web Service Consumer activity for RESTful Web Service. | |
Step-by-step instructions to override REST URL at runtime. | |
- In Create Web Service Provider Screen, enter the name and description of the new Web Service Provider activity in the Name and Description textboxes respectively (see Figure 362).
...
|
|
- The parameterName attribute of the context source should be restRequest.
- The parameterName attribute of the context target should be restResponse.|
- The parameterName attribute of the context source should be restRequest.
...
| For the parameters that you want to pass as a part of HTTP header, select the Header option in the Style drop-down list. |
...
- Select the type of method from the Method Type drop-down list. The method type can be PUT, GET, POST, or DELETE. As per the type of method that you select, you will see a corresponding content in the Presentation Table (see Figure 364).
...
| For the parameters that you want to pass as a part of HTTP header, select the Header option in the Style drop-down list. |
...
| To know how to create Security policy, refer to the Creating Security Policy for Web Service section. |
...
| A lot of WSDL files by default come with a dummy endpoint that do not point to the actual location of the service, but instead contains a dummy link, for example - http://example/servicename. This is because sometimes the WSDL file describes what the service looks like, but do not point where it is located. Therefore it should be possible to override the endpoint from within the Web Service Consumer configuration instead of having to do via the Process Designer. |
...
Step-by-step instructions to create Web Service Provider activity for RESTful Web Service. |