Monday 4 February 2008

Doing ebMS Ping Pong

Intro
The ebXML is an upcoming B2B standard that is supported by Integration B2B. I think it is groing in importance. Check out http://www.ebxml.org/specs/ for more info.
Actually ebXML is a set of standards of which ebMS describes the transport layer. One great feature of the ebXML standard is that it describes a ping functionality. You might think "Oh right, what's so cool about ping? We have that for ages in TCP/IP.". But this is a ping on a different level, since ebMS is a protocol that lies on top of http and uses SOAP. The standard also describes functionality like Multi-Hop, that provides the possibility to send messages to the tradingpartner using intermediate message-brokers. This is especially handy in those setups where a group of tradingpartners have to work together and all have their own security architecture with firewalls, etc. Without an intermediate broker all tradingpartners have to know the ip-addresses and ports of all the other tradingpartners. With an intermediate broker all have to know only the ip-address and port of the intermediate broker and once connected to this broker a tradingpartner is logically connected to all the other connected tradingpartners.

But then it is particullarly handy to check if two tradingpartners can exchange messages without affecting the "business", thus without having to send a "real" message with fictive test-date.
Sending a ping message to a tradingpartner with a B2B gateway that supports the ebMS ping-functionality will let the remote B2B gateway respond with a "pong" message.

Doing the setup in B2B
Each trading partner on both sides have to have a Collaboration Protocol Agreement (CPA) implemented with the same Agreement ID. I won't explain how to do that here, since that is part of the normal B2B course. For Axway/Cyclone that is the whole trick, for Integration B2B a few additional steps has to be done.
First create a new business-action called "Ping". Create a document type "Ping" attached to it, with a revision "1.0". (The name business action is important, the name of the document type and revision is not).
At the document definition fill in the following parameters (without the enclosing double-quotes):
  • Document Routing ID: "EBMS_PO"
  • Service: "urn:oasis:names:tc:ebxml-msg:service"
  • Identification Expression (XPath) for XML Document: "/*[local-name()='Ping']"



Add this business action as a supported business action to the capabilities of the remote tradingpartner. You could add it both for initating and responding actions. Mark that since this is a special message in itself that does not need an acknowledgement, you could set the acknowledgement mode to "none".

Then add the supported business actions as a participant to the agreement and validate and deply that agreement.

Now you could test this by enqueueing a message on the ip-in-queue with dbms_aq.enqueue using the parameters as configured.
The responding pong message is found in the wiremessage-report. Unfortunately the wiremessages report does not show the actions.

Advanced Ping
At my current customer we have a tradingpartner that has actually two endpoints on two different locations. We implemented that as a tradingpartner with two agreements and two separate routing-id's.
We used to have the ping action added to both agreements. But trying to ping this tradingpartner gives the error "tradingpartner agreement details not found". Off course, because B2B does not know what agreement to use for the ping and thus it also does not know which routing id to use.
So I solved this first to remove the ping-participants from one of the agreements.
Then I created a new business action named something like PingACME. I created the document type and document definition just like I described above for the "normal" ping. The document definition has another parameter set however:
  • Action Name: "Ping"
Then add this one also to the capabilities (initiating and responding) of the trading partner and add it to the other agreement as participants (the one from which the normal ping-participants were removed). When the agreement is redeployed than also the second agreement can be used for a Ping, by using PingACME as a business action.

This trick can also be used if you want several business actions with different document type settings but that have to result in the same ebMS-action.

1 comment :

LLLLL said...

Hi,
Thanks for the reply I entered Sammple data given by you.But invocation itself fails saying dateTime value required. xsd:dateTime format is 'YYYY-MM-ddTHH:mm:ss