Page History
...
Find below an overview on the REST methods provided by the example:
Resource | REST Method | Description | Tag httpMethod | Input | In via | Output (body) | ||||
---|---|---|---|---|---|---|---|---|---|---|
supportcases | GET | get a support case overview | GET or blank | none | SupportCaseInfo, a complex object containing some general information on the resource. In the example, these are number of support requests and a list of customers afflicted by support cases. | |||||
GET/ | query support cases | GET or blank | none | ListOfSupportCases
| ||||||
status | query | |||||||||
customerName | query | |||||||||
POST | create a new support request | POST | SupportCase | body | SupportCase | |||||
supportcase | GET | get a specific support case | GET or blank | id | path | SupportCase | ||||
DELETE | close support case | DELETE | id | path | ResolveMessage (Please also see note above.) | |||||
customer | GET/ | get all support cases of a specific customer | GET or blank | customerId | path | ListOfSupportCases (Please also see note above.) |
For more information on REST parameters, e.g. input methods, see section REST Parameters further below.
...
Named methods are methods that refer to a HTTP method, but have a divergent name, e.g. resolve in the support case manager example.
To call such an method, append its name (or relativePath) to the parent resource.
Resource | REST Method | Description | Tag httpMethod | Input | In via | Output (body) |
---|---|---|---|---|---|---|
supportcase | resolve | set the status of the support case to resolve | PUT | id | path | ResolveMessage |
Error Handling
Multiexcerpt | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Each REST port type should have a <<RESTError>> class assigned. The E2E Bridge will use this class as output in case of error (see Defining a REST Service Interface). In the support manager example, REST port type SupportAPI has class RESTError assigned as error class. Using function
Assign the error object and a HTTP status code that corresponds to the error. This information will be returned via the HTTP response.
In the support manager example, if user does not provide a support case id with the REST call, the implementation is as follows: Error Handling for Specific Error ClassesIf you defined a specific error class or Blob (Bridge 7.1.0) for a specific HTTP status code as described on Defining a REST Service Interface, you can use the same way as described above to provide the error details to the response. Provide the error details to an instance of the specific error class or Blob and provide the error class to the response object. |
...
The REST method can provide multiple output parameters via the response headers. These parameters can be of simple type or array of simple type.
Info |
---|
As of Runtime 2019.1,we changed how the Runtime handles header parameters that are not set. If you do not set a header parameter that is defined for an operation, this parameter is omitted and not provided in the response headers. |
Example
Activity diagram Get All Support Cases of Customer shows the implementation of a header output parameter. It implements a GET request support cases of a specific customer. The support case data is provided via the response body as an array of complex type, the record count is provided via the response headers.
...