Application Integration (On-Premises) : Creating REST applications : Setting Up Your REST Application : Setting Up a REST Application on Integration Server : Services
Services
Services for REST Resources Configured Using the Legacy Approach
When you build a REST application on your Integration Server by configuring resources using the legacy approach, you must include services that correspond to the HTTP methods you want to provide for each resource. These services must be named as follows:
Service
Description
_get
Performs the GET method.
_put
Performs the PUT method.
_post
Performs the POST method.
_patch
Performs the PATCH method.
_delete
Performs the DELETE method.
These services reside in folders on your Integration Server in a directory structure that is specific to your application. For example, the discussion application described in Configuring a REST Resource Using the Legacy Approach might have the following structure as viewed from Software AG Designer:
In addition to the _get, _put, _post, _patch, and _delete services, you can also place a special service named _default in one or more of the application folders. Integration Server executes this service if a REST request specifies an HTTP method that is not represented by a service in the folder. For example, suppose the folder contains the _get, _put, and _post services, but no _patch or _delete service. If the client issues a DELETE request, Integration Server will execute the _default service, and pass “DELETE” to it in the $httpMethod variable.
If a request specifies an HTTP request method that is not represented by a service in the folder and there is no _default service in the folder, the request fails with the “404 Not Found” or “405 Method Not Allowed error.” Integration Server issues 404 if the first token in the URI does not exist in the namespace, or 405 if one or more tokens in the URI identify elements in the namespace but the URI does not correctly identify a REST resource folder and a service to execute.
Example 1
A REST resource’s folder contains the _get, _post, and _default services:
If the client sends a...
Integration Server responds by...
GET request
Executing the _get service
POST request
Executing the _post service
DELETE request
Executing the _default service
Example 2
A REST resource’s folder contains the _get, _put, and _delete services:
If the client sends a...
Integration Server responds by...
GET request
Executing the _get service
PUT request
Executing the _put service
POST request
Issuing error “405 Method Not Allowed”
Additional possible uses for the _default service are:
*Direct all REST requests through common code before branching off to individual GET, PUT, POST, PATCH, or DELETE methods.
*Make PUT and POST processing the same by directing PUT and POST requests to the same code.
Services for REST Resources Configured Using the URL Template-Based Approach
The URL template-based approach helps you configure REST resources for an existing Integration Server service. The HTTP methods that you can configure for a REST resource are restricted only by the methods that you configure as allowed for the underlying service. The methods supported by a REST resource must be a subset of the methods allowed for the service corresponding to the REST resource. For information about configuring the supported methods for a REST resource and its corresponding Integration Server service, see the webMethods Service Development Help.
If a REST request specifies an HTTP method that is not allowed for its service, the request fails with a “405 Method Not Allowed error.
Example 1
A REST service and its corresponding resource support the GET, PUT, and DELETE services:
If the client sends a...
Integration Server responds by...
GET request
Executing the GET method
PUT request
Executing the PUT method
POST request
Issuing error “405 Method Not Allowed”
Note:  
This example assumes that the request URL is in a format supported by the REST resource.
Copyright © 2015- 2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback