SBM Orchestration Guide → Orchestration Use Cases → Using Custom Endpoints with RESTCaller
Using custom endpoints in orchestrations enables you to externalize the location of a REST resource from the orchestration design. If you have defined a custom endpoint to use with your REST service calls, the custom endpoint implementation enables you to access endpoint data and dynamically extend the URL. Following are some ways you can use custom endpoints with RESTCaller:
You can use the authentication set in a custom endpoint as the authentication for the REST service call that will be made by your RESTCaller step. To configure this, do the following:
The typical use case is where you may have a resource server for the QA environment and a separate resource server for the Production environment. For example:
While the resource path is constructed the same way in both cases, the server address is different. By creating a custom endpoint, you can set the service address to the correct value for the particular environment at the point of deployment without having to change the orchestration or create some custom mechanism.
In this case, you would simply map the custom endpoint Url parameter to the RESTCaller restUrl argument, since the value you want for the server is set at the time of deployment.
Another use case is where a REST service provides access to a number of different resources. For example, these can be collections of resources, such as an initial resource that returns a list of states as follows:
With additional resources that return a specific set of data values concerning San Francisco, such as the following:
You could use an orchestration step to calculate a particular resource path depending on some separately provided value. For example you might pass the values, state = CA and city = SanFrancisco to the orchestration through its event structure or some other means. You could add an orchestration step to calculate the URL to pass to the REST service, taking the base URL from the custom endpoint as follows:
and constructing the resource path from the data given and appending it to the URL provided by the custom endpoint as follows:
Finally, you would pass the following constructed URL to the RESTCaller restUrl parameter.
Some REST services use the HTTP query string to provide additional ways of selecting the resource. You can append these query parameters to the URL as a properly-formatted HTTP query and map them to the RESTCaller restUrl parameter or you can provide them as an array of key-value structures using the RESTCaller params argument, leaving RESTCaller to append the query string.
For more information on RESTCaller, refer to Calling RESTful Web Services from an Orchestration Workflow.
Copyright © 2007–2019 Micro Focus or one of its affiliates. All rights reserved.