Using the HTTP Binding Component
HTTP Binding Component Example Scenario
The following purchase order example illustrates how an HTTP Binding Component can be used in a composite application. In this example scenario, a single HTTP Binding Component acts as both a service provider and service consumer.
Purchase Order Example
A medical supply company provides a web site that contains a line of products for pre-approved customers only. One of these customers, a clinic, logs onto the web site and orders 1000 surgical masks and 2000 pairs of latex gloves. The purchase order is received and stored by the medical supply company's server, and a response is sent back to the clinic to confirm that the order has been received.Figure 1 HTTP Binding Component Acting as Service Provider and Service Consumer
HTTP Binding Component Acting as Service Provider and Service Consumer
The purchase order handling system in this scenario is represented by a web service implemented using GlassFish with the JBI framework.
The actors in this situation are as follows:
- Web Client — Packages up the purchase order as a SOAP request and sends it to the server.
- HTTP Binding Component — Sends and receives HTTP and SOAP messages.
- BPEL Service Engine — Responsible for implementing the core business logic of fulfilling the purchase order.
- Normalized Message Router (NMR) — Routes normalized messages between JBI components. In this scenario, it routes normalized messages to and from the HTTP BC and the BPEL SE.
Scenario Message Flow
The steps of the purchase order scenario message flow follow the numbers in the diagram above.
- The SOAP message is sent to a web service endpoint hosted by the HTTP Binding Component.
- The HTTP Binding Component transforms the SOAP message into a normalized message. The normalized message is sent to the Normalized Message Router.
- The Normalized Message Router routes the normalized message to the BPEL Service Engine.
- The BPEL Service Engine interprets the purchase order information and properly invokes other BPEL processes to fulfill the request.
- The BPEL Service Engine creates a response message in the form of a Normalized Message. The normalized message is sent to the Normalized Message Router.
- The HTTP Binding Component receives the response message and converts it to a SOAP message. The SOAP message is sent back to the web client as a proper response as defined by the WSDL.
- The web client takes the response and creates a human-readable HTML page to inform the customer whether the purchase order was accepted or rejected.