Welcome!

Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

Introduction to ebXML

Making collaboration easier

With today's increasing demand for businesses to communicate with each other, business-to-business (B2B) integration holds the key to successful e-commerce collaboration.

The first problem that companies generally face when interacting with each other is how to transfer information that is understood by the organizations involved. Standards, therefore, are an important contributor in helping different partners to interoperate. Many standards have arisen to solve integration problems. While each of them have addressed this issue in different ways, ebXML-Messaging has gained market traction as one of the mature protocols that has resolved reliability and security issues around integration.

ebXML-Messaging is an integration standard from OASIS that provides an XML-based infrastructure to enable consistent, secure, and interoperable message exchange. This specification is part of a series of specifications published by OASIS to define an end-to-end B2B framework. It encapsulates the notion of B2Bi conversations and enforces rules of engagement agreed upon by involved parties. It is transport independent and extends SOAP Messages with Attachments to enable the exchange of business messages containing payloads of any format. Further, it defines transport-level acknowledgements and error messages, eliminating the need to explicitly model them in business processes.

BEA WebLogic Integration 8.1 leverages these features of ebXML to provide a highly productive environment for implementing effective trading partner integration strategies by implementing the ebXML 1.0 and 2.0 Messaging Specification that is integrated with BEA WebLogic Workshop. It simplifies the entire process of designing B2B choreography by eliminating the need to configure the Trading Partner Repository upfront and manages conversations with different trading partners seamlessly. Apart for this, it provides some very useful features for reliable messaging, error handling, and message tracking.

In this article, I look at ebXML Conversations and how they are mapped to an ebXML Control and modelled in business processes. I'll provide some insight into conversation management with WebLogic Integration 8.1 and look at the trading partner configurations required for it. Finally I'll look at the product features mentioned above.

ebXML Conversation
ebXML conversation is at the heart of trading partner integration. It carries the context for messages being exchanged by trading partners. Each ebXML message carries in its envelope an ebXML Service Name and Conversation ID that identifies the conversation it belongs to. The message exchanges represent business activities occurring as part of that conversation and are called ebXML Actions. An ebXML conversation always involves an initiator and a participant. The initiator trading partner may instantiate several conversations with different trading partners as part of a single business process. ebXML control is used to model each of these conversations for the initiator. The participant, on the other hand, participates only in one conversation and therefore the business process itself represents an ebXML conversation on its end.

This concept can be clearly understood using an order-processing scenario. Let's assume an integration scenario between BEA and Avitek, a computer manufacturing company. BEA places purchase orders with Avitek to buy computers. Avitek, on receiving the purchase order from BEA, responds with an invoice. BEA thus becomes the initiator of this conversation while Avitek acts as the participant. BEA and Avitek agree on OrderProcessing as their conversation name, which will have two business activities, processOrder and processInvoice.

ebXML Control
The initiator business process may have multiple ebXML controls and/or ebXML control instances based on the number of conversations it needs to carry. In our case, BEA starts a single conversation with Avitek. Hence we need only one ebXML control and control instance. An ebXML control can be created using the Control Wizard seen in Figure 1. The control name specified here, OrderControl, is used as a TPM Service name as we will see later. An important aspect of the control is the annotations it will carry. An ebXML control has an ebXML service name, From id, To id, and ebXML action mode annotations (see Listing 1). The production values for the From and To ids should be duns' number or actual ids for BEA and Avitek. It may very well be that these trading partners are not yet configured in the trading partner repository. The workflow designer may need to test the choreography to ensure the correctness of the business process logic without getting into the actual details of configuring the TPM Repository. To avoid the hassle of going back and forth from the WebLogic Workshop IDE to the WebLogic Integration Console, the developer may use the out-of-the-box TPM data available with the product. Another use case can be when the same business process is used as part of various integration scenarios. The processes are made agnostic of trading partners by using the to-selector, from-selector control instance annotations that take in XQuery Selectors as their value.

 

Once the ebXML Control is created, we modify the method names in the control to reflect the ebXML action name decided by BEA and Avitek. The method to send the order thus becomes processOrder and the method to receive the invoice is named processInvoice (see Listing 1).

A control thus created can be shared across different business processes. The design question that generally arises is, "when can I reuse a previously created ebXML control and when should a new one be created?" The answer is simple. The initiator trading partner can reuse the control if it needs to carry out another conversation with the same participant using the same reliable messaging and security settings. If the reliability and/or security settings required are different while conversing with the same trading partner, a new ebXML control should be created.

Modelling an ebXML Conversation for the Initiator
The OrderControl created above will now be used to model conversation in BEA's buyer business process. The initiator process can be started via a Message Broker or simple ClientRequest (see Listing 2). Once the start node is modelled, we use OrderControl to model an ebXML conversation. Methods of the control are displayed at the right bottom corner in the design view in the WebLogic Workshop IDE (see Figure 2). As decided by BEA and Avitek beforehand, BEA will send an order to Avitek; hence, we drop the processOrder method in the process. As part of the same conversation, Avitek will respond with the invoice. We drop the processInvoice method in BEA's business process to receive this invoice. Any extra logic for processing received invoices can be implemented in this method. With this step, BEA's business process is complete.

 

Modelling an ebXML Conversation for the Participant
As I mentioned earlier, the business process for the participant by itself represents an ebXML conversation. Hence we see an ebXML service name as a JPD annotation in Listing 3 that has snippets from Avitek's business process. As decided by two parties, OrderProcessing is specified as an ebXML service name. The participant process is always started by an ebXML message received from the initiator. The Java method name associated with this node represents the action name of the ebXML message to be received and is in our case called processOrder. Now Avitek needs to respond back to BEA with an invoice after fetching it from the file system. This response has to be part of the same ebXML conversation and is modelled using the client callback mechanism. By using a ClientCallback to send a response, the responsibility of ensuring that the message is sent as part of the same conversation is delegated by the workflow designer to the underlying message service handler (MSH). This way of modelling an ebXML participant falls inline with the Web Services Provider model wherein the provider of the service may send an asynchronous response to the consumer of the service using the WebServices Callback mechanism. The Java method in the callback interface becomes the ebXML action name and is named processInvoice as decided by BEA and Avitek earlier. Figure 3 shows the design view of this JPD.

 

Behind the Scenes
Once the business processes for participant and initiator trading partners are designed, orchestration between these processes is carried on by starting the BEA initiator process from a browser. The processOrder method is invoked as part of BEA's process execution. It invokes the ebXML MSH internally and passes the payloads (received as method arguments) to the MSH. The MSH creates a new conversation and encapsulates its ID in an ebXML SOAP envelope along with the service name OrderProcessing and action name processOrder. It creates an ebXML message using this envelope and adds payloads as SOAP Attachments. The ebXML message created is sent to the trading partner identified by to-id in the control annotation. The reliability and security semantics for sending a message are derived from BEA's profile in the Trading Partner Repository while the transport endpoint is derived from to-id Avitek's profile.

On Avitek's end, the receiving MSH extracts the ebXML service name, action name, and conversation ID from the incoming message to identify the conversation this message belongs to. If the message indicates a new conversation, it creates a new instance of a business process using the service name to identify the process type. It uses an ebXML action name to invoke the right node in the process. Thus, the processOrder method of Avitek is invoked and user code defined in this method is executed.

As Avitek's process executes further, it reaches the ClientCallback node that is supposed to respond to BEA. The ClientCallback method processInvoice internally calls sending ebXML-MSH, which creates an ebXML envelope encapsulating the same conversation ID it received from BEA's message to indicate that the response is part of the same conversation. It also encapsulates the processInvoice as the action name and OrderProcessing as the ebXML service name in the outgoing message.

The message eventually reaches BEA, which uses the conversation ID from the incoming message to identify the related conversation. The system thus guarantees messages sent and received via an ebXML control instance are part of a single ebXML conversation.

The conversation ID also helps to identify the business process instance the message should berouted to. Finally, an ebXML Action name is used to route the message to BEA's processInvoice ControlCallback node. User code specified in the processInvoice method is executed next.

Configuring the Trading Partner Repository
At this point, the business processes for BEA and Avitek are designed and tested using out-of-the-box trading partners. To run these business processes in production, we need to configure profiles for BEA and Avitek. This configuration can be done via the WebLogic Integration Console or using the offline Bulkloader tool. Listing 4 displays TPM data that can be directly uploaded for our example. As seen in the listing, the trading partner configuration is now made easy with only two root elements: trading partner and service. The trading partner element has protocol binding as child element. A trading partner may have one or more protocol binding per protocol name and version. Figure 4 displays the BEA-ebxml20-binding protocol binding. As seen, it contains Protocol information, transport endpoints, reliable messaging parameters and a security configuration for BEA.

 

The other root element, service, has one or more service profiles, which tie together the trading partners that need to converse. It is configured differently for the initiator and participant (see Figure 5). The participant trading partner Avitek has a business process name as the service name and the service type is "PROCESS". The initiator trading partner BEA has an ebXML control name specified as the service name and the service type is "SERVICECONTROL".

 

The service ebXML.order.OrderControl in Listing 4 indicates that BEA, when interacting with Avitek, uses the BEA-ebxml20-binding binding. BEA communicates with Avitek using ebXML 2.0 protocol and OnceAndOnlyOnce reliable messaging mode. Similarly the service /ebxmlWeb/ebxml/order/Seller.jpd is used by Avitek when interacting with BEA.

Messaging Reliably
BEA WebLogic Integration 8.1 supports four reliable messaging modes for ebXML 2.0 Point-to-Point Messaging: Once and Only Once, Atmost Once, Atleast Once, and BestEffort. For ebXML 1.0 messaging, it provides two Reliable Messaging modes: BestEffort and Once and Only Once.

  • BestEffort: The fastest mode as it does not care for acknowledgement or duplicates.
  • Atleast Once: Acknowledgement is requested but duplicate messages aren't checked.
  • Atmost Once: Duplicates are checked but the message is not acknowledged.
  • Once and Only Once: The most reliable mode as the message is acknowledged and the duplicates are checked.

    When BEA sends a purchase order, Avitek's MSH sends a low-level acknowledgement that can be viewed in JPD. BEA, as the initiator, can simply model the acknowledgement for viewing by dragging/dropping the onAck ebXML control method. Avitek, as the participant, does not have the ebXML control. It uses the ClientRequest node and system-level method onAck to model acknowledgments.

    Modelling Error Messages
    It may happen that the message received by a peer-trading partner is erroneous. For example, Avitek cannot parse the purchase order sent by BEA. In that case, Avitek sends an error message to BEA. This message can be modelled in BEA's business process for viewing by dragging/dropping the onError ebXML control method. An ErrorList indicating actual errors can then be extracted from the ebXML envelope that is modelled as an argument to onError method.

    Exposing ebXML Envelope
    The SOAP-based ebXML Envelope sent with the ebXML message contains important elements like From and To Party; Message Id, used to track messages; ebXML Conversation ID, used to track the conversations; ErrorList, sent with the error message; and Signature, to name a few of them. With BEA WebLogic Integration 8.1, the ebxml envelope can be viewed in the business process as org.xmlsoap.schemas.soap.envelope.EnvelopeDocument XBean by specifying the annotation on the method used to receive the message in question. Listing 3 displays the @jpd:ebxml-method envelope method annotation used by Avitek's jpd while Listing 1 displays the control annotation @jc:ebxml-method envelope="{env}" used by BEA's jpd. The method argument specified in these annotations is the one that will contain the message envelope when the corresponding receive node is invoked.

    The ebXML envelope for the outgoing message can be exposed in the business process by specifying XmlObject as the return type of method used to send the message in question. Each element of ebXML envelope can further be extracted and mapped to Java objects using the data transformation tool embedded in the WebLogic Workshop IDE. The schema for ebXML envelope required to view its elements for mapping is available as part of the system schemas that come with WebLogic Integration 8.1.

    Message Tracking
    BEA and Avitek can monitor messages they have sent and received and their status using the WebLogic Integration Console. Different levels of message tracking can be set in the TPM Repository at the root level. For granular control, it can also be set at the service profile level. There are three levels of message tracking: ALL, Metadata, and NONE. With the tracking level set to ALL, the contents as well as the Metadata of all the messages exchanged are tracked and displayed in the WebLogic Integration Console.

    The metadata of the message includes a conversation ID related to message exchange; a business process ID, an action name representing the message exchange; a time when the message was sent/received; a message status for whether the message was successfully sent or received; a status description; the size of the message, action, transport protocol; and so on. With message tracking set to metadata, the contents are not tracked. The tracking level should be set as required. Using the highest level adversely impacts performance.

    References

  • BEA WebLogic Integration 8.1: http://commerce.bea.com/index.jsp
  • BEA WebLogic Integration Documentation: http://e-docs.bea.com/workshop/docs81/doc/en/core/index.html
  • ebXML Tutorial: An extensive tutorial to create various B2B Integration Scenarios with ebXML: http://dev2dev.bea.com/codelibrary/code/tptutorial.jsp
  • ebXML-MSH 1.0 Specification: www.ebxml.org/specs/ebMS.doc
  • ebXML-MSH 2.0 Specification: www.ebxml.org/specs/ebMS2.pdf
  • SOAP1.1 Specification: www.w3.org/TR/2000/NOTE-SOAP-20000508
  • SOAP with Attachments specification: www.w3.org/TR/2000/NOTE-SOAP-attachments-20001211
  • More Stories By Komal Mangtani

    Komal Mangtani is a senior software engineer working on BEA’s Weblogic Integration product. She implemented ebXML Business Protocol for WebLogic Integration 8.1 and is a member of the ebXML committee in OASIS. Komal works in the area of high availability for the product.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    IoT & Smart Cities Stories
    Dion Hinchcliffe is an internationally recognized digital expert, bestselling book author, frequent keynote speaker, analyst, futurist, and transformation expert based in Washington, DC. He is currently Chief Strategy Officer at the industry-leading digital strategy and online community solutions firm, 7Summits.
    Digital Transformation is much more than a buzzword. The radical shift to digital mechanisms for almost every process is evident across all industries and verticals. This is often especially true in financial services, where the legacy environment is many times unable to keep up with the rapidly shifting demands of the consumer. The constant pressure to provide complete, omnichannel delivery of customer-facing solutions to meet both regulatory and customer demands is putting enormous pressure on...
    IoT is rapidly becoming mainstream as more and more investments are made into the platforms and technology. As this movement continues to expand and gain momentum it creates a massive wall of noise that can be difficult to sift through. Unfortunately, this inevitably makes IoT less approachable for people to get started with and can hamper efforts to integrate this key technology into your own portfolio. There are so many connected products already in place today with many hundreds more on the h...
    The standardization of container runtimes and images has sparked the creation of an almost overwhelming number of new open source projects that build on and otherwise work with these specifications. Of course, there's Kubernetes, which orchestrates and manages collections of containers. It was one of the first and best-known examples of projects that make containers truly useful for production use. However, more recently, the container ecosystem has truly exploded. A service mesh like Istio addr...
    Digital Transformation: Preparing Cloud & IoT Security for the Age of Artificial Intelligence. As automation and artificial intelligence (AI) power solution development and delivery, many businesses need to build backend cloud capabilities. Well-poised organizations, marketing smart devices with AI and BlockChain capabilities prepare to refine compliance and regulatory capabilities in 2018. Volumes of health, financial, technical and privacy data, along with tightening compliance requirements by...
    Charles Araujo is an industry analyst, internationally recognized authority on the Digital Enterprise and author of The Quantum Age of IT: Why Everything You Know About IT is About to Change. As Principal Analyst with Intellyx, he writes, speaks and advises organizations on how to navigate through this time of disruption. He is also the founder of The Institute for Digital Transformation and a sought after keynote speaker. He has been a regular contributor to both InformationWeek and CIO Insight...
    Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...
    To Really Work for Enterprises, MultiCloud Adoption Requires Far Better and Inclusive Cloud Monitoring and Cost Management … But How? Overwhelmingly, even as enterprises have adopted cloud computing and are expanding to multi-cloud computing, IT leaders remain concerned about how to monitor, manage and control costs across hybrid and multi-cloud deployments. It’s clear that traditional IT monitoring and management approaches, designed after all for on-premises data centers, are falling short in ...
    In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
    Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...