...
Figure 1: Message Endpoint EIP
Example scenario
The following diagram depicts an example scenario is an inventory for stocks. It illustrates how , where a stock quote is generated when a request is sent to the ESB. from a client to a service (Stock Quote Service). The sender sends the request to the ESB, where the request is then diverted which diverts the message to the stock quote service. The diagram below depicts how to simulate the example scenario using the ESB.
Figure 2: Example scenario of the Message Endpoint EIP
Before digging into the implementation details, let's take a look at the relationship between the example scenario and the Message Endpoint EIP, by comparing their core components.
...
You need to set up the ESB, and the back-end service:
- Download the
Message-Endpoint_1.0.0.zip
file, which includes the ESB configuration described above. See Setting up the Environment for instructions on setting up the ESB and the back-end service.
Info When you set up the environment, note that you only need to start one instance of the back-end service (Stock Quote Service) to simulate this example.
Executing the sample
Send the following request to the ESB, by using a SOAP client. When you send the request, you will need the wsdl URL of the proxy service defined in the ESB configuration. The default wsdl URL for this proxy service is http://localhost:8280/services/message-endpoint-proxy?wsdl.
Code Block |
---|
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd"> <soapenv:Header/> <soapenv:Body> <ser:getQuote> <ser:request> <xsd:symbol>foo</xsd:symbol> </ser:request> </ser:getQuote> </soapenv:Body> </soapenv:Envelope> |
...
When you send the request, the ESB first receives the message and then routes it to the back-end service (StockQuoteService). The following output will be printed on the Axis2 server's console, confirming that the request is successfully received by the back-end service.
Code Block |
---|
samples.services.SimpleStockQuoteService :: Generating quote for : foo |
You The generated stock quote will then be sent to the client application (SOAP UI). You can view the response in the SOAP UI as follows:
...