Processing B2B message and attachment using AS4 protocol in Integration


This article explains how the attachment can be sent using the AS4 protocol.


It is assumed that readers of this article know how to set up a B2B enterprise profile, partner on the B2B platform, and create of flow service.


• Set up B2B enterprise profile, partner profile, Business Document and TPA.
• Flow service to send and receive the AS4 message.
• This article is in continuation with the previous AS4 article. It is recommended to follow the below article.

Topics Covered

  • Develop flow service to send and receive messages along with attachments using AS4 protocol in integration using One-Way/Push mechanism.
  • End to End working flow.


  • In our use case we have 2 tenants one tenant from whom we will submit the transactions and another tenant who will receive the transaction.
  • In our use case in B2B Sender is “Silver Brew Enterprises” and Receiver is “Agile Software”
  • We will submit the shipment order XML message and edi attachment from integration using the B2B operation.
  • The message is received at the receiver’s b2b side and then the message is passed to Integration for further processing.
  • In Integration attachment is extracted using GetContentParts operation in the B2B application.

Setup is done on B2B

Configuration for source tenant

Enterprise Profile

Partner Profile

Outbound Channel for AS4 Protocol

Configure trading partner agreement

  • AS4 protocol, all the configuration, and details are configured at the TPA level.
  • It has become quite critical we configure the TPA with all mandatory details. During run time all the configurations are referred from TPA only.
  • Attaching the TPA zip file for reference. (2.9 KB)

• Configuration for Destination tenant

Enterprise Profile

Partner Profile

Create Inbound AS4 channel

Create a Processing rule to process the received message.

Trading partner agreement for destination tenant (3.0 KB)

Assets developed on Integration layer

Source tenant

• Attached is the flowservice for the same. (12.7 KB)

Destination tenant

  • Developed asset to receive the message from B2B.
  • In our case we have developed the flow service “ExtractContentFromB2B”.
  • This will receive the data from B2B and extract the content using B2B application.

Attached is the flow service for the same. (10.7 KB)


  • In our case we have set extract attachment as false in the TPA. Therefore we have to extract the attachment using GetContentParts operation using B2B application.

End-to-End Testing

  • Submit the message to B2B from flow service “SubmitAS4MessageWithAttachment”.

Transaction received on Integration