
Processing Business Data Using the Plain HTTP Adapter
Purpose
The
plain HTTP adapter enables you to receive from and to send business data to external systems, using the plain HTTP inbound/outbound channels of the Integration Engine.The standard exchange format for data in the Integration Engine is XML. However, using the plain HTTP adapter you can also send and receive data in HTML and ASCII. In a case such as this, you must configure the mapping correspondingly; this means that you must use a Java mapping.
Prerequisites
The
HTTP service /sap/xi/adapter_plain supplied by SAP, must be assigned to the client in which you run the Integration Engine.
Process Flow
An HTTP client sends business documents to the Integration Engine using HTTP. A message is generated from the business document and transferred to the Integration Engine. If, on the other hand, the Integration Engine identifies a plain HTTP receiver, a business document is generated from the message and sent to the receiver. This communication is either synchronous (the client awaits a response to its HTTP request) or asynchronous.
Integration Engine: HTTP Inbound Channel
The Integration Engine is called by external systems using HTTP and a URL. For this purpose, the HTTP inbound channel of the Integration Engine contains the HTTP service /sap/xi/adapter_plain, delivered by SAP.
The class CL_HTTP_PLAIN_INBOUND is provided as a request handler that processes an HTTP request synchronously (client awaits a response) or asynchronously.
![]()
Multi-part documents and HTTP requests with an empty HTTP body are not accepted and receive a response with status code 500 or 204.
The obligatory parameters of the URL are analyzed and used to construct the message.
Mandatory Parameters
|
Parameter |
Meaning |
|
bs |
Business system partner to identify the sender. |
|
namespace |
Namespace of the sender interface. |
|
interface |
Interface of the HTTP payload. |
Example URL:
http://sap-ag.com:8088/sap/xi/adapter_plain?bs=sender&namespace=urn:sap-ag.com&interface=/sap/orders
The optional parameters of the URL are also analyzed. They affect the runtime response of the message in the Integration Engine.
Optional Parameters
|
Parameter |
Meaning |
|
qos |
Quality of service: Synchronous (BE) or asynchronous (EO) processing; the default setting is synchronous processing. |
|
msgguid |
32 character message ID; uniquely identifies a message in the Integration Engine. If no message ID is specified, the system generates it internally. |
Example URL:
http://sap-ag.com:8088/sap/xi/adapter_plain?bs=sender&namespace=urn:sap-ag.com&interface=/sap/orders&qos=EO&msgguid=3C61F6C12F1E2DD1E10000000A1145AB
![]()
You must code special characters such as forward slash (/), hyphen (-), or colon (:) with escape characters (for example,
%2F for /, %2D for -, and %3A for :).Optional HTTP header fields are ignored.
The payload in the HTTP body is appended as a binary document to the message. The payload should be sent as an XML document with code page UTF 8, so that all services of the Exchange Infrastructure can process the document.
The instantiated message is transferred to the Integration Engine. In mode BE (synchronous processing) the system waits for the response from the Integration Engine. If processing is successful, the payload of the message is sent as an HTTP response. If not, the system returns an error.
If processing is successful, the HTTP client has the return code 200. Otherwise, it has the return code 500, or 409. If an error occurs, the error object of the message contains an error message. In the synchronous case, this is placed in the HTTP body of the HTTP response; in the asynchronous case, it is given as the error cause to the HTTP request.
Integration Engine: HTTP Outbound Channel
The plain HTTP adapter is called by the Integration Engine, if technical routing identifies a plain HTTP
end point for the logical receiver. This end point originates from the Integration Directory. It is analyzed and provides the technical information for the HTTP request:The main payload of the message is sent as HTTP post to a URL. The technical data for the HTTP post is determined from the end point of the message. An HTTP client is instantiated for a logical destination, in which the URL, proxy data, user/password, and SSL are maintained. If no destination is specified, the system instantiates an HTTP client using the specified URL and the proxy data. A basic authentication is entered in the HTTP header fields with a user and password in BASE64 code.
The optional header fields maintained in the end point, are set in the HTTP header.
The header fields Content Type (if not already explicitly set),Content Length and the host are set by default.
In the URL, the sender business system is set as parameter bs and the interface used as parameters namespace and interface. Depending on the current quality of service (qos) of the message, the parameter qos is also added to the URL.
The HTTP body comprises the prolog, message payload, and epilog. Prolog and epilog are optional and
enhance the payload for particular servers (or CGI servers). If the payload is to be sent as an HTML form using HTTP post, it is URL-encoded beforehand.If the specified code page for the HTTP body does not correspond to the default setting UTF 8, the system converts the HTTP body to the corresponding code page; in the XML document, the system replaces the tag
encoding=UTF-8 with the corresponding code page tag.If the quality of service is set to Best Effort, the system awaits a response from the HTTP server. The system appends this response to the message as a new payload, while it deletes the old main payload.
The system logs any errors that occur in the message.