Using DataPower IDG Appliance as B2B gateway. Barebone sample of B2B gateway to process ebXML request.

Using DataPower IDG Appliance as B2B gateway. Barebone sample of B2B gateway to process ebXML request.

Electronic Business using eXtensible Markup Language, commonly known as e-business XML, or ebXML  is a family of XML based standards sponsored by OASIS and UN/CEFACT whose mission is to provide an open, XML-based infrastructure that enables the global use of electronic business information by all trading partners.

The ebXML work address the issues of older, EDI-based, standard way of exchanging data. It aims to simplify and decrease the cost of setting up the exchange of business transactions data while preserving standard compliance, interoperability, security, and consistent manner of exchanging data. ebXML replace EDI formats by XML and provide own interface and protocol.

In this chapter we will show how to use B2B functionalities of the DataPower Appliance in order to exchange the ebXML data between two partners.

Lets consider the simplified scenario with automotive dealer and maker.





Scenario:

Dealer uses Dealer's front-end in order to create purchase order. The dealer's backend creates the Purchase order in ebxml format.

?xml version="1.0" encoding="UTF-8"?>
<tns:PurchaseOrder xmlns:tns="http://edi.ibm.com/2010/types/transnet">
   <tns:senderID>DEALER_BUSINESS_ID</tns:senderID>
   <tns:receiverID>MAKER_BUSINESS_ID</tns:receiverID>
   <tns:mfrCode>FRI</tns:mfrCode>
   <tns:orderNumber>92002</tns:orderNumber>
   <tns:orderDate>20101001T120101000Z</tns:orderDate>
   <tns:shipToDC>IND</tns:shipToDC>
   <tns:messages>
      <tns:message>It is a bright sunny Friday here.</tns:message>
      <tns:message>Test Data DO NOT SHIP This is a test</tns:message>
   </tns:messages>
   <tns:items>
      <tns:item sequence="1">
         <tns:partNumber>ZS327R</tns:partNumber>
         <tns:orderQuantity>15</tns:orderQuantity>
      </tns:item>
      <tns:item sequence="2">
         <tns:partNumber>ZS876</tns:partNumber>
         <tns:orderQuantity>20</tns:orderQuantity>
      </tns:item>
      <tns:item sequence="3">
         <tns:partNumber>ZS722</tns:partNumber>
         <tns:orderQuantity>3</tns:orderQuantity>
      </tns:item>
   </tns:items>
   <tns:lineCount>8</tns:lineCount>
</tns:PurchaseOrder>

The order then gets submitted trough DataPower IDG B2B gateway to the Maker Information system. Maker information system receives the encrypted message from dealer trough DataPower IDG B2B gateway as well. It's to underline here that it can be any other compliant ebXML solution.

DataPower IDG B2B gateway ensure transactional character of the exchange, provides encryption, traceability and logging of the exchanged artifacts.

Let implement the schema here-above. In order to simplify the setup, let's create single domain DP_B2B_PROC_EBXML which is going to host both dealer's and maker's configuration.


The domain will host 2 business gateways. Because the data flow for this scenario is from Dealer to Maker we create OUTBOUNDB2BGATEWAY for Dealer and INBOUNDB2BGATEWAY for Maker.

Let's configure Dealer's B2B Gateway OUTBOUNDB2BGATEWAY.

The gateway can connect to internal backend using unencrypted connection, but in order to connect to the external third party over general purpose Internet connection it must do it in secured way.

For the connection from inside of the Dealer's network we may use variety of protocols. 



In order to simplify the scenario let use plain http. We configure HTTP front side handler listening on the 600003 tcp port.



Every B2B gateway must refer to two B2B Partner profiles : one internal B2B Partner profile and one external B2B Partner profile. Because dealer's information system is internal regarding OUTBOUNDB2BGATEWAY, and maker's information system is external,  we create INTERNAL_DEALER_PROFILE and EXTERNAL_MAKER_PROFILE to use with OUTBOUNDB2BGATEWAY.

Internal dealer profile configuration.

For our scenario the internal dealer profile configuration must have business id filled. We must use the business id value corresponding to the sender id from ebXML payload.
   <tns:senderID>DEALER_BUSINESS_ID</tns:senderID>

External maker profile configuration 

The partner id of the external maker profile must match the receiver id from ebXML documents:

   <tns:receiverID>MAKER_BUSINESS_ID</tns:receiverID>

The other parameter important for external profile is destination : 

Destination Name:	MAKER_FRONTEND (default)
Destination URL: ebms2://0.0.0.0:60001
Enabled Document Type: XML, X12, EDIFACT, Binary	 

It's time to proceed to the main B2B gateway configuration. Main tab:


On the XML Format tab we must configure routing policy :

OUTBOUND_XML_Routing_Policy



For each of the fields we must provide the xpath to extract the mandatory values from the payload. The available Xpath tool can assist with coding when the sample of payload is available.

For our purchase order:

/*[namespace-uri()='http://edi.ibm.com/2010/types/transnet' and local-name()='PurchaseOrder']/*[namespace-uri()='http://edi.ibm.com/2010/types/transnet' and local-name()='senderID']

/*[namespace-uri()='http://edi.ibm.com/2010/types/transnet' and local-name()='PurchaseOrder']/*[namespace-uri()='http://edi.ibm.com/2010/types/transnet' and local-name()='receiverID']

/*[namespace-uri()='http://edi.ibm.com/2010/types/transnet' and local-name()='PurchaseOrder']/*[namespace-uri()='http://edi.ibm.com/2010/types/transnet' and local-name()='orderNumber']

/*[namespace-uri()='http://edi.ibm.com/2010/types/transnet' and local-name()='PurchaseOrder']/*[namespace-uri()='http://edi.ibm.com/2010/types/transnet' and local-name()='orderDate']

Now let's configure Maker's B2B Gateway INBOUNDB2BGATEWAY.

The inbound connection is supposed to arrive from other ebXML enabled host. Therefore we must configure the front side handler for ebms connection. We configure it to listen to 60001 port. 


The dealer's host is external regarding INBOUNDB2BGATEWAY and the maker's information system is, indeed, internal. Therefore the next step is to configure external Dealer profile EXTERNAL_DEALER_PROFILE.


For internal partner profile INTERNAL_MAKER_PROFILE the configuration looks like following :



The default destination on Destinations tab: 

Destination Name: MAKER_BACKEND (default)
Destination URL	: http://0.0.0.0:60007
Enabled Document Type: 	XML, X12, EDIFACT, Binary

Overall setup:


Testing the overall setup : 

In order to test overall setup we simulate maker backend implementing loopback XML firewall :



In order to simulate dealer's backend we use curl tool as follows : 

curl --data-binary @PurchaseOrder.xml http://172.16.242.134:60003/  -H 'Content-type: text/xml'

The results can be seen and download trough B2B transaction viewer menu:


Leave a Reply

You must be logged in to post a comment.



 
       
iBudget    |   No More Money Falling Through Your Fingers        Home page
 
App store
Available on the iPhone
 
    Why Using Feedburner in Blogs Is So Important?