Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 7 Managing RESTful Web Services : Creating a RESTful Web Service

Creating a RESTful Web Service
TIBCO ActiveMatrix BusinessWorksTM Plug-in for REST and JSON supports binding HTTP requests from a custom RESTful web service to TIBCO ActiveMatrix BusinessWorks processes.
You can create a custom RESTful web service in the following ways:
Use the Service Editor tab of the REST Dispatch and Reply activity to create a RESTful web service. See Creating a RESTful Web Service with Service Editor for details.
If a RESTful web service is created in this way, the binding process can be performed directly in the Service Editor tab. See Service Editor for details.
If a RESTful web service is created in this way, to bind the HTTP requests, you must select the Enable WADL Reference check box and select the created WADL file in the WADL Reference field in the Configuration tab, and then perform the binding process in the Service Editor tab. See REST Dispatch and Reply for details.
Creating a RESTful Web Service with Service Editor
To create a RESTful web service, complete the following steps:
1.
In TIBCO Designer, define a process and expand the REST and JSON palette in the Palettes panel. See Getting Started for details about how to define a process.
2.
Drag the REST Dispatch and Reply icon from the Palettes panel to the Design panel.
3.
In the Configuration tab, select HTTP Receiver from the Reply For list.
4.
In the Service Editor tab, right-click the Application node in the left panel, and then select Add > RestService. A service node with the default name, RESTService0, is added under the Application node. See RESTful Web Service for details about the RESTful web service.
Ensure that the Enable WADL Reference check box is cleared in the Configuration tab.
5.
6.
Right-click the newly added service node in the left panel and select Add > Resource. A resource node with the default name, Resource0, is added under the service node.
7.
8.
Right-click the newly added resource node and select Add > Method. A method node with the default name, Method0, is added under the resource node. See Method for details about the method element.
9.
See Service Editor for details about how to bind this HTTP request to a TIBCO ActiveMatrix BusinessWorks process.
The following steps: step 10 and step 11 are optional. If you want to define additional or specific parameters for a method node, except for parameters inherited from the parent resource node, you can add a request node to specify more parameters.
10.
Right-click the method node, and then select Add > Request or Add > Response. A request node or a response node are added under the method node.
11.
Enter parameters used for the request node or response node. See Request and Response for details about the request and response components.
Creating a RESTful Web Service with a WADL Palette
You can create a custom WADL file to describe a RESTful web service by using the WADL palette.
To create a WADL file, complete the following steps:
1.
2.
Expand the WADL folder in the Palettes panel and drag the Application icon to the Design panel.
3.
4.
Double-click the Application icon in the Design panel, and then drag the RestService icon from the Palettes panel to the Design panel.
5.
6.
Double-click the RestService icon in the Design panel, and then drag the Resource icon from the Palettes panel to the Design panel.
7.
8.
Double-click the Resource icon in the Design panel, and then drag the Method icon in the Palettes panel to the Design panel.
9.
10.
Double-click the Method icon in the Design panel, and then drag the Request icon in the Palettes panel to the Design panel.
11.
12.
Drag the Response icon from the Palettes panel to the Design panel.
13.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved