Skip to Content
Technical Articles
Author's profile photo Bhalchandra Wadekar

EIPinCPI – Document Message

Previous – Command Message | Index | Next – Event Message

This week, we study another variation of Message pattern known as Document Message.

When do I use this pattern?

A Command Message invokes functionality in the target system, whereas, a Document Message is just a message sent to the target system. A Document Message does not tell the receiver system what to do with the message. Examples of the Document Message pattern include a response message from an invoked SOAP operation and sending an Email.

Document Message in CPI

A response message from an invoked SOAP operation

Last week, I commanded W3 Schools to convert 37 ℉ to Celsius. The full response message from W3Schools is:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd="">
        <FahrenheitToCelsiusResponse xmlns="">

Here, the content between Body element is a document message returned to CPI without telling CPI what to do with it. CPI chose to log that response for monitoring.

Sending an Email

Another example of Document Message is sending an Email. When an email is sent, the email server is free to choose the future of the received message. Some examples of future actions taken by the email server are to assign a tag to the email, move the email to the junk folder, add a line at the top to say “This Email is from External Network. Be careful when clicking on links.”, and so on.

Integration Flow

This is a simple integration flow. It starts as soon as it is deployed and sends the email document.


Start Immediately

Similar to previous flows in this blog series, this integration flow starts immediately after deployment using the configuration of Run Once in Timer Start.

Mail Adapter

For configuring the Mail Adapter, I’ll refer you to the blog: Gmail Connectivity from CPI.

Here are the configurations I used:

Tab Parameter Value
Connection Address
Connection Authentication Plain User/Password
Connection Credential Name Gmail Credentials
Connection From My Email Address
Connection To My Email Address
Connection Subject EIPinCPI
Connection Mail Body Hello, World!


When integration flow is deployed, I receive the email in my Google Account.

Integration Recipe

The code is available as Integration Recipe on SAP’s official repository: EIP-MessageConstruction-DocumentMessage


Document Message pattern is a variation of Message pattern. Unlike the Command Message pattern, Document Message pattern does not include telling the receiver system what to do with the message.

References/Further Readings

Hope this helps,

Previous – Command Message | Index | Next – Event Message


Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.