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

« Previous Version 3 Next »

This section explains the process of creating web service provider service for RESTful Web Service. 

Follow the steps below to create a REST Provider:

  1. Click Configure > WEB SERVICES > REST Provider.

  2. Click Create REST Provider
  3. In Create REST Provider window, type the name and description of the new Web Service Provider service in the Name and Description fields respectively.



  4. By default, Character Set Encoding field will display the character set encoding that you have defined at the application level. In case, the Web Services Provider service 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 field. 

  5. Type API Version, for example, your API version can be 1.1.
  6. Type the resource end path URL in the Resource End Path field. 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 {}.  

  7. Select the process flow name to trigger with the web service from the Process Flow Name field.

    1. 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.
    2. The parameterName attribute of the context source should be restRequest.
    3. The parameterName attribute of the context target should be restResponse.
  8. To define the resource parameters, type the name, default value, and style of the parameters in the NameDefault Value, and Style fields.

    For the parameters that you want to pass as a part of HTTP header, select Header corresponding to the parameters in the Style field.

  9. To add methods to your activity, click Add Method and do the following.


     

    1. Select the type of method from the Method Type field. 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.  

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

      For the parameters that you want to pass as a part of HTTP header, select the Header option in the Style field. 

    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 layout 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 fields. 
    6. Click Save.
  10. Select the security policy from the Security Policy field.

    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.

  11. Click Save.

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

    Variable Name

    Description

    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.

  12. After you have created the web service, you can now add the API Documentation.

  • No labels