This section explains the process of creating web service provider activity for RESTful Web Service.
Steps to create REST Provider activity
Click Configure > WEB SERVICES > REST Provider.
Click Create REST Provider.
On Create Provider (API) window, type the name and description of the new Web Service Provider activity in the Name and Description text boxes.
By default, Character Set Encoding text box will display the character set encoding that you have defined at the application level. In case, the Web Services Provider activity contains characters which fall in character set encoding other than the default character set encoding, then you can change this encoding in the Character Set Encoding text box.
Type API Version, for example, your API version can be 1.1.
Type the resource end path URL in the Resource End Path text box.The URL can be static or dynamic. Static URL example: /rest/WeatherForecast Dynamic URL example: /rest/{ServiceName} where service name is a variable, for example, WeatherForecast. The variable name in the Dynamic URL must be in the curly braces {}.
Select the process flow name to trigger with the web service from the Process Flow Name drop-down list.
The selected process flow must have Context Source and Context Target activity: GET and DELETE can only have Context Target whereas PUT and POST can have both Context Source and Context Target activity.
The parameterName attribute of the context source should be restRequest.
The parameterName attribute of the context target should be restResponse.
To define the resource parameters, type the name, default value, and style of the parameters in the Name, Default Value, and Style text boxes.
For the parameters that you want to pass as a part of HTTP header, select Header corresponding to the parameters in the Style drop-down list.
To add methods to your activity, click Add Method and do the following.
Select the type of method from the Method Type drop-down list. The available method types are PUT, GET, POST, and DELETE. Depending upon the selection of the method type, the content of the Presentation table appears.
In the Method Parameter table, define the method parameters. Type the name, default value, and style of the parameters in the Name, Default Value, and Style text boxes.
For the parameters that you want to pass as a part of HTTP header, select the Header option in the Style drop-down list.
In the Presentationtable, set the Media Type as application/text, application/xml, or application/json. If you set media type as XML or json, select Request layout for the selected media type.
Set the Status Codecorresponding to the types.
In the Response Headers table, define your own headers. Type the name and values in the Name and Value text boxes.
Click Save.
Select the security policy from the Security Policy drop-down list.