Documentos de Académico
Documentos de Profesional
Documentos de Cultura
endpoint
This blog is part of a collection of blog entries that shows architectural concepts and configuration of the SAP
PI REST Adapter. We also added some sample scenarios to make it easier for you to understand how your
scenario can be implemented using the PI REST Adapter.
If you haven’t done so far, best is to start with the very first blog PI Rest Adapter - Don't be afraid
within the blog series covering the concepts of the REST adapter. A complete list of all blog
entries can be accessed from here PI REST Adapter - Blog Overview.
The current blog shows you along a sample scenario how to define a dynamic endpoint using a placeholder.
Scenario
We will enhance the flight scenario from the previous blog PI REST Adapter – JSON to XML conversion where
a travel agency gathers flight details from an airline. Besides the flight details query, the travel agency likes to
check the availability of flights. Depending on the respective service name as part of the endpoint URL, the
travel agency either calls BAPI_FLIGHT_GETDETAIL or BAPI_FLIGHT_CHECKAVAILABILITY.
In the SAP Process Integration Designer perspective of the NetWeaver Developer Studio (NWDS), we open
the existing Integration Flow and add an interface split together with the new inbound interface. Select the
interface split, and maintain the condition. In the condition, we use the adapter specific message attribute with
name service and namespace http://sap.com/xi/XI/System/REST. The attribute is set within the REST sender
channel, see below. For service equals getdetail, the request is routed to BAPI_FLIGHT_GETDETAIL. For
service equals checkavail, the request is routed to BAPI_FLIGHT_CHECKAVAILABILITY.
The REST adapter comes with a set of predefined adapter specific message attributes such as resource,
service, and id which are commonly used among RESTful services. We use the service attribute to hold the
name of the service. As dynamic attribute select REST Service (service) from the drop down menu. The Value
Source is the beforehand defined URL Pattern Element service_part.
The rest of the configuration remains unchanged. For details, refer to the blog PI REST Adapter – JSON to
XML conversion.
The response provides us the flight details such as destination and schedule in JSON format.
You can access the dynamic attributes values from the DynamicConfiguration message header. In the
message monitor, select the corresponding message, switch to tab Message Content, and open the
DynamicConfiguration message header.
Here you can see that the service attribute value is either checkavail or getdetail.
I hope this blog was helpful to understand the options that you have to define custom endpoints within the SAP
PI REST adapter. If you like to learn more, check out the other blogs in the series, accessible from the main
blog PI REST Adapter - Blog Overview.