This section explains the process of creating web service provider activity for RESTful Web Service.
Steps to Use Web Service Provider Activity to Publish RESTful Web Service
...
On the Develop tab, click Services > Web Service > Provider (API).
Click Create New.
...
...
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 the resource end path URL in the Resource End Path text box. Provided end path 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.
Info |
---|
The variable name in the Dynamic URL must be in the curly braces {}. |
...
Select the process flow name that you want to trigger with this web service from the Process Flow Name drop-down list.
Info |
---|
|
...
To define the resource parameters, type the name, default value, and style of the parameters in the Name, Default Value, and Style text boxes.
Info |
---|
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
...
...
Select the type of method from the Method Type drop-down list. The available method types are PUT, GET, POST, or 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.
Info |
---|
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 security policy from the Security Policy drop-down list.
Info |
---|
For information on how to create a Security Policy, refer to Creating Security Policy for Web Service. The RESTful Web Service Provider supports both basic and API authentication. |
...
Click Save.
Info | ||||||||
---|---|---|---|---|---|---|---|---|
When a RESTFul web service is invoked by a Consumer, following information is saved in the process flow context:
You can view the value of these variables in Process Flow Context, within Process Flow Logs. Also, you can view these variables within your process flow using put-context-var action. |
...
Add API Documentation
To add API Documentation for RESTful web services:
- On the Develop tab, click Services > Web ServiceServices > Provider (API).
- Click Action to the Restful web service.
Click Add Documentation.
An The Add API Documentation window appears with API and Method Details for the chosen RESTful web service. By default, the values in the API Details section are filled automatically based on the chosen web service. You can change the values as per your requirements.
API Details Description Name Name of the API Documentation. By default, it shows the provider's value as the name. Description Description about the API Documentation. Contact Email Valid email address to send queries. Title Title of your API documentation. It must contain alphanumeric and few special characters (_ - . : , @ $ ? \\ and space) and must start with an Alphabet/Underscore/Number) Method Details Description Summary Purpose of the method. Notes Description about of the method. API ParametersDefine API parameters by clicking Add Row List of parameters, if provided at the time of creating Web Service Provider activity. Method Presentation Status code of the request, response, and fault. You can also provide the description of the status code. - Click Save.
...
Viewing Endpoint URL
...
After you have created RESTful Web Service for the Provider Activity, you can also view the Endpoint URL and API documentation. To view Endpoint URL and API Docof a web service activity:
- Go to Develop > Services > Web ServiceServices > Provider (API) .
- Click Click Endpoint in in the WSDL/Documentation column corresponding to the web service to view the Endpoint URL.Endpoint URL will appear in a activity.
This displays the Endpoint URL in the new tab of your browser. - Click Close Window to exit.
- Click API Doc to view the API documentation.
API document will open in a new window.
Info Changing Logo/Image in API Documentation
Property "
Viewing API Documentation
To view API documentation of a web service activity:
- Go to Develop > Services > Web Services > Provider (API) .
Click API Doc in the WSDL/Documentation column corresponding to the particular web service activity.
Info Click API Doc to view the API documentation of all web service activities.
This displays the API documentation of the selected activity in the new tab of your browser.
Option Name Description Show/Hide Show or hides all APIs. List Operations Displays the list view of all the expanded APIs. Expand Operations Expands all APIs to view details. Info The list of all web service activities populates on the screen, in case you are viewing API documentation of all web service activities.
Select the activity from the left menu to view API details of a particular activity.- Click API method or Expand Operations to view API details.
Provide the details in the fields and click Try it out to view the response.
Changing Logo/Images in API Documentation
To change the logo of the API documentation:
- Go to .../<AdeptiaInstallFolder>/AdeptiaServer/ServerKernel/etc folder.
- Open server-configure.properties file in the Text Editor.
- Set the path of the logo/image in the abpm.webservice.rest.apidoc.imagepath" has been added to the server configure properties for which default url is property. The default URL is "images/api_doc_header.png".To change the logo, change the image name from url. The dimension of the image should be between 50x50 and 50x650. Supported image types are PNG, GPGJPG, GIF, and BMP."
- Click API method to view API documentation details.
Click Try it out to view the response.
Info You can also view the API documentation of all web service providers populated on one screen by clicking API Doc from the Web Service Provider manage screen.
Save the file.