Implementing ebXML Message Service in WebSphere Partner Gateway V6.2

ebXML Message Service (ebMS) provides a standard way to exchange business messages among ebXML trading partners without relying on proprietary technologies. This article shows you how to use ebMS with IBM® WebSphere® Partner Gateway V6.2.

Share:

Sonali Samantaray (sonali.samantaray@in.ibm.com), Software Engineer, IBM

Photo of Sonali SamantaraySonali Samantaray is a Software Engineer on the WebSphere Partner Gateway team at the IBM India Software Lab. She has a Masters Degree in Computer Applications and is an IBM Certified DB2 Associate and IBM Certified SOA Associate. Sonali has published technical documents for various symposiums as well as several IBM developerWorks articles. You can contact Sonali at sonali.samantaray@in.ibm.com.


developerWorks Professional author
        level

Prashant Yadav (prashaya@in.ibm.com), Software Engineer, IBM

Photo of Prashant YadavPrashant Yadav works is a Software Engineer on the WebSphere Partner Gateway team at the IBM India Software Lab. He has a Masters Degree in Computer Applications and his specialties include B2B security and B2B protocols such as EDI, AS1, AS2, AS3, and ebXML2.0. He led the interoperability product certification runs for WebSphere Partner Gateway on the AS2 and ebMS 2.0 B2B protocols as administered by the Drummond Group Inc. You can contact Prashant at prashaya@in.ibm.com.



15 February 2012

Setting up the ebMS environment

ebMS messaging requires you to upload an XML file called a Collaboration Profile Agreement (CPA) before documents can be defined. Importing the CPA into WebSphere Partner Gateway V6.2 causes the following operations to be performed:

  • Create partners
  • Define document definitions
  • Enable required business-to-business capabilities
  • Create specified gateways
  • Create interactions and connections

To upload a CPA XML file:

  1. Click Hub Admin => Hub Configuration => ebMS.
  2. Click Upload CPA.
  3. Click Browse and select the appropriate CPA package.
  4. Ensure that ebMS Version 2.0 is selected.
  5. Click Upload.
Figure 1. Uploading CPA File
Uploading CPA File

The upload panels walk you through the partner selections. If there is a conflict between the partners defined in CPA and already existing partners within a hub, you will be able to choose between the two partners. During the CPA upload process, you will be asked to select the initiating or receiving partner from the partners in the CPA. Figure 1 above shows that the CPA had two partners, IntPart and ExtPart. IntPart is the initiating partner that sends the ebMS message and receives the ebMS response. From the panel, you can choose an existing partner or create new partners.

Figure 2 shows the default outbound connections (between the internal and external partner) created after the CPA import:

Figure 2. Default outbound connections
Default outbound connections

Figure 3 shows the default inbound connections (between the external and internal partner) created after the CPA import:

Figure 3. Default inbound connections
Default inbound connections

Setting up synchronous ebMS flow

The sender of an ebMS message can use a synchronous communications protocol such as HTTP to receive the associated response message over the same connection used to deliver the request message. In the case of HTTP, the sender of the HTTP request message containing an ebXML message needs to have the response ebXML message delivered to it on the same HTTP connection.

Sync Reply Mode is the attribute you need to set for synchronous transactions. For the complete ebMS request and response, you need to set this attribute in both inbound and outbound channels:

  1. Navigate to Account Admin => Connections for the outbound channel.
  2. Select the Source and Target Partner from the dropdown.
  3. Click Search.
  4. Click Attributes on the Target side.
  5. Click Action.
  6. Set the value of the attribute Sync Reply Mode as mshSignalsOnly for the inbound channel.
  7. Select the Source and Target Partner from the drop down,
  8. Click Search.
  9. Click Attributes on the Source side.
  10. Click Action.
  11. Set the value of the attribute Sync Reply Mode as mshSignalsOnly.

Setting up asynchronous ebMS flow

Sync Reply Mode is also the attribute you need to set for asynchronous Transactions. For the complete ebMS request and response, you need to set this attribute in both inbound and outbound channels:

For the outbound channel:

  1. Navigate to Account Admin => Connections.
  2. Select the Source and Target Partner from the dropdown.
  3. Click Search.
  4. Click Attributes on the Target side.
  5. Click Action.
  6. Set the value of the attribute Sync Reply Mode as none.

For the inbound channel:

  1. Select the Source and Target Partner from the dropdown.
  2. Click Search.
  3. Click Attributes on the Source side.
  4. Click Action.
  5. Set the value of the attribute Sync Reply Mode as none.
Figure 4. Setting the Synchronous attribute
Setting the Synchronous attribute

Enabling security

WebSphere Partner Gateway V6.2 provides support for both inbound and outbound ebXML messages. For message security , the ebXML 2.0 specification recommends using Enveloped XML Digital Signature and XML Encryption. WebSphere Partner Gateway V6.2 supports both XML Encryption and SMIME Encryption. If all three options are enabled, messages are first compressed, then signed, and finally encrypted. No other order is possible in WebSphere Partner Gateway V6.2, although all possible combinations of one, two, or three options are supported. For example, you can compress only, sign only, encrypt only, sign and encrypt, encrypt and compress, and so on.

WebSphere Partner Gateway V6.2 supports synchronous and asynchronous acknowledgments and signed and unsigned acknowledgments. Synchronous and asynchronous errors also supported. An error message will always be sent when a business message fails. Errors can be sent synchronously or asynchronously, depending on the type of acknowledgment requested. ebXML error messages are never signed. In cases where error messages cannot be sent, a SOAP fault is generated and sent to the sender.

To sign an outbound ebMS message:

  1. Navigate to Account Admin => Connections.
  2. Select the Source and Target partner from the dropdown.
  3. Click Search.
  4. Click Attribute on the Target side.
  5. Click Action.
  6. For the attribute Digital Signature required select Yes.
Figure 5. Enabling digital signature
Enabling digital signature

To encrypt an outbound ebMS message:

  1. Navigate to Account Admin => Connections.
  2. Select the Source and Target partner from the dropdown.
  3. Click Search.
  4. Click Attribute on the Target side.
  5. Click Action.
  6. For the attribute Encryption required select Yes, as shown in Figure 6 below.
  7. Select an Encryption Algorithm from the dropdown.
  8. Select an Encryption Protocol from the dropdown.
Figure 6. Enabling Encryption
Enabling Encryption

To compress an outbound ebMS message:

  1. Navigate to Account Admin => Connections.
  2. Select the Source and Target partner from the dropdown.
  3. Click Search.
  4. Click Attribute on the Target side.
  5. Click Action.
  6. For the attribute Compression required select Yes.

Ping-pong messages

A ping message is an ebXML message with no payloads, and is used to determine whether or not the receiving partner is up and running. A partner receiving a ping message replies back with a pong message. Receipt of a pong message tells the sender that the partner is up and running and ready to receive. ebMS lets you ping ebMS partners, which means that you can send a ping message to a partner, and if the partner is up and ready to receive, the partner responds with a pong message. Once you upload a CPA, the ping-pong channel is created.

When you configure for ebMS ping and pong documents, consider the following facts:

  • Only the ping connection needs to be created. The pong connection uses the existing ping connection.
  • For a ping connection from an internal partner to an external partner, the connection's source destination is not used.
  • For a ping connection from the external partner to an internal partner, the connection's source destination is used to send the reply pong document back to the external partner.

To ping an ebMS partner:

  1. Click Tools => Test Partner Connection.
  2. For Command, select Ping ebMS.
  3. Select From Partner and To Partner.
  4. Optionally, select a destination or type a URL.
  5. Click Test to send a ping message.

To enquire about the status of the ping message, click Ping Status. The status for the last ping request is displayed under Results. The last ping request may have been initiated from the Test Partner Connection or from a Document Viewer resend of an existing ping document.

If you are not using a CPA, then you need to enable B2B capabilities and create a channel for the ebMS ping message as follows:

For outgoing ebMS ping messages

Source-side B2B capability:

  • Package: N/A (N/A)
  • Protocol: ebMS (2.0)
  • Document Type: MSHService (2.0)
  • Activity: MSHService (2.0)
  • Action: Ping(N/A)

Target-side B2B capability:

  • Package: ebMS (2.0)
  • Protocol: ebMS (2.0)
  • Document Type: MSHService (2.0)
  • Activity: MSHService (2.0)
  • Action: Ping(N/A)

For incoming ebMS ping Message

Source-side B2B capability:

  • Package: ebMS (2.0)
  • Protocol: ebMS (2.0)
  • Document Type: MSHService (2.0)
  • Activity: MSHService (2.0)
  • Action: Ping(N/A)

Target-side B2B capability:

  • Package: N/A (N/A)
  • Protocol: ebMS (2.0)
  • Document Type: MSHService (2.0)
  • Activity: MSHService (2.0)
  • Action: Ping(N/A)

You should then activate the channel and set destinations from the partner connection page. This information holds true for ebMS error and acknowledgment -- the action for these channels changes to MessageError and Acknowledgment, respectively.

ebMS viewer

The ebMS Viewer displays information about ebMS documents. You can display raw documents and associated document processing details and events using specific search criteria. This information is useful when determining whether a document was successfully delivered or when diagnosing a problem.

To display the ebMS Viewer:

  1. Click Viewers => ebMS Viewer.
  2. Select the appropriate search criteria.
  3. Click Search.
Figure 7. ebMS results
ebMS results

To see the details of a particular conversation/transaction, click on the glass icon:

Figure 8. ebMS details
ebMS details

In the ebMS Viewer, documents are organized based on conversation ID, which means that all the documents with the same Conversation ID are grouped together and can be seen by clicking the More details icon on the left side of each row of conversation ID. When you click More details, a new page displays showing all the messages in that conversation. On the top of the page, an attribute called Conversation Status shows the next message expected in that conversation.

ebMS status request/response messages

A status request message is an ebXML message with no payload that is used to identify the status of an earlier business message. On receiving a status request, a trading partner replies with a status response message containing the status of the message specified in the status request message. The message status can be Unauthorized, Not Recognized, Received, Processed, or Forwarded. Ping/pong, status request, and status response messages can be signed using XML digital signatures.

To request the status of an ebMS message, complete the following steps:

  1. After you have found the ebMS document that you are interested in, click the View details icon next to it.
  2. Click Request Status. The status of that document is displayed.
  3. To refresh the status, click View Status.

When you configure for ebMS Status Request and Status Response documents, consider the following:

  • Only the Status Request connection needs to be created. The Status Response connection uses the existing Status Request connection.
  • For a Status Request connection from an internal partner to an external partner, the connection's Source Destination is not used.
  • For a Status Request connection from an external partner to an internal partner, the connection's Source Destination is used to send the reply Status Response document back to the external partner.

If you are not using a CPA, then you need to enable B2B capabilities and create a channel for ebMS Status Request messages as shown below:

For outgoing ebMS Status Request message

Source-side B2B capability:

  • Package: N/A (N/A)
  • Protocol: ebMS (2.0)
  • Document Type: MSHService (2.0)
  • Activity: MSHService (2.0)
  • Action: StatusRequest(N/A)

Target-side B2B capability:

  • Package: ebMS (2.0)
  • Protocol: ebMS (2.0)
  • Document Type: MSHService (2.0)
  • Activity: MSHService (2.0)
  • Action: StatusRequest(N/A)

For incoming ebMS Status Request message

Source-side B2B capability:

  • Package: ebMS (2.0)
  • Protocol: ebMS (2.0)
  • Document Type: MSHService (2.0)
  • Activity: MSHService (2.0)
  • Action: StatusRequest(N/A)

Target-side B2B capability:

  • Package: N/A (N/A)
  • Protocol: ebMS (2.0)
  • Document Type: MSHService (2.0)
  • Activity: MSHService (2.0)
  • Action: StatusRequest(N/A)

Next, activate the channel and set destinations from the Partner Connection page.

Message ordering

Message ordering enables messages to be presented to a back-end system in a particular order. The message sender puts a sequence number starting from zero on each message in a conversation. The receiving hub delivers the message to the back-end system only when all messages with lower sequence numbers have been delivered, which means that messages wait in the hub until all messages with lower sequence numbers have been delivered. A message may expire while waiting for the lower sequence number messages to arrive, and in this case an XML event is generated and sent to the back end.

Conclusion

This article showed you how to use extensive ebMS functionality with WebSphere Partner Gateway V6.2 to exchange business messages among B2B trading partners.

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Business process management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Business process management, WebSphere, Industries
ArticleID=793637
ArticleTitle=Implementing ebXML Message Service in WebSphere Partner Gateway V6.2
publish-date=02152012