Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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

  1. On the Develop tab, click Services > Web Service > Provider (API).

  2. Click Create New.


     

  3. Type the name and description of the new Web Service Provider activity in the Name and Description text boxes.

  4. 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. 

  5. Select REST in the Publish Type.
  6. Type API Version, for example, your API version can be 1.1.
  7. 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.  

    The variable name in the Dynamic URL must be in the curly braces {}. 

     

  8. Select the process flow name that you want to trigger with this web service from the Process Flow Name drop-down list.

    1. The selected process flow must have Context Source and Context Target activity: GET and DELETE can only have Context Target whereas PUT and SOURCE can have both Context Source and Context Target activity.
    2. The parameterName attribute of the context source should be restRequest.
    3. The parameterName attribute of the context target should be restResponse.
  9. To define the resource parameters, type the name, default value, and style of the parameters in the NameDefault 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.

  10. To add methods to your activity, click Add Method. Do the following.

     

    1. 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. 

       

    2. In the Method Parameter table, define the method parameters. Type the name, default value, and style of the parameters in the NameDefault 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. 

    3. In the Presentation table, set the Media Type as application/text, application/xml, or application/json. If you set media type as XML or json, select Request Schema for the selected media type.



    4. Set the Status Code corresponding to the types.
    5. In the Response Headers table, define your own headers. Type the name and values in the Name and Value text boxes. 
    6. Click Save.
  11. Select the security policy from the Security Policy drop-down list.

    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.

  12. Click Save.

    When a RESTFul web service is invoked by a Consumer, following information is saved in the process flow context:

    Variable NameDescription
    InvokedURLURL which has been hit by the consumer
    InvokedMethodMethod through which web service has been invoked: GET, POST, PUT, DELETE
    InvokedResourceEndPathContains the actual ResourceEndPath from the invoked URL

    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.

  13. After you have created the web service, you can now Add or Edit the API Documentation.

Add API Documentation

To add API Documentation for RESTful web services:

  1. On the Develop tab, click Services > Web Service > Provider (API).
  2. Click Action  to the Restful web service.
  3. Click Add Documentation.



  4. An Add API Documentation window appears for the chosen RESTful web service.

    API DetailsDescription
    NameName of the API Documentation. By default, it shows the provider's value as the name.
    DescriptionDescription about the API Documentation.
    Contact EmailValid email address to send queries.
    TitleTitle of your API documentation. It must contain alphanumeric and few special characters (_ - . : , @ $ ? \\ and space) and must start with an Alphabet/Underscore/Number)
    Method DetailsDescription
    SummaryPurpose of the method.
    NotesDescription about the method.
    API ParametersDefine API parameters by clicking Add Row.
    Method PresentationStatus code of the request, response, and fault. You can also provide the description of the status code.
  5. Click Save.

View Endpoint URL and API Documentation

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 Doc:

  1. Go to Develop > Services > Web Service > Provider (API) .
  2. Click Endpoint in the WSDL/Documentation column corresponding to the web service to view the Endpoint URL.
  3. Endpoint URL will appear in a new tab of your browser.



  4. Click Close Window to exit.
  5. Click API Doc to view the API documentation. 

    API document will open in a new window.

    Changing Logo/Image in API Documentation

    Property "abpm.webservice.rest.apidoc.imagepath" has been added to the server configure properties for which 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, GPG, GIF, and BMP."

  6. Click API method to view API documentation details.



  7. Click Try it out to view the response. 

    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.

     



  • No labels