Cloud Application Integration (On-Premises) : Service Development : Working with REST : Creating a REST Resource
Creating a REST Resource
You can use Designer to generate a REST resource automatically, specifically the REST resource folder, the flow services that correspond to HTTP methods, and, if selected, the _default flow service. When Designer generates the REST resource folder and services, Designer assigns each service the required names and creates an input signature that accepts the predefined parameters for a REST request.
Keep the following points in mind when using Designer to create a REST resource:
*The REST resource name must be unique across the entire Integration Server namespace. That is the fully-qualified name of the REST resource must be unique on the Integration Server.
*You can select the HTTP methods for which you want Designer to create a service.
*You can instruct Designer to create a _default service to handle the HTTP methods for which there is not a specific service.
*The format of the request URI depends on the location of the REST resource. For more information about the format of the request URI, see the REST Developer’s Guide.
To create a REST resource
1. In the Service Development perspective, select File > New > REST Resource.
2. In the New REST Resource dialog box, select the package or folder in which you want to create the REST resource.
3. In the Rest resource name field, type a name for the REST resource using any combination of letters, numbers, and/or the underscore character. For information about restricted characters, see About Element Names.
4. Click Next.
5. Under HTTP methods, select the check box next to the methods for which you want to create a separate service. Select the Default check box to create a service that handles any methods that are not selected.
Note:  
You can select Default only if at least one of the HTTP methods is not selected.
6. Click Finish.
Designer creates the REST resource folder and generates services for the selected HTTP methods.
Notes:
*The signatures for the flow services generated by Designer contain only the input parameters $resourceID and $path which are required by Designer acting as the REST server. These parameter are optional and can be deleted.
You might delete $resourceID and/or $path if your REST application does not use the values supplied by those variables.
*The _default service also contains a required input parameter named $httpMethod.
*After creating the services, you need to modify the service signature to include any additional input parameters expected by the service and any output parameters produced by the service.
*The services generated by Designer are empty. You must add processing logic to the generated services.
Copyright © 2015- 2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback