10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Overview of the Coffee Break Application<br />

1022<br />

FIGURE 36–1 Coffee Break Application Flow<br />

SAAJ<br />

Coffee Supplier<br />

Web Service<br />

request_prices<br />

order_coffee<br />

Coffee Break<br />

Server<br />

HTTP<br />

Coffee Break<br />

Client<br />

JAX-WS<br />

Coffee Supplier<br />

Web Service<br />

<strong>The</strong> Coffee Break server obtains the coffee varieties and their prices by querying suppliers at<br />

startup and on demand.<br />

1. <strong>The</strong> Coffee Break server uses SAAJ messaging to communicate with one of the suppliers.<br />

<strong>The</strong> Coffee Break has been dealing with this supplier for some time and has previously made<br />

the necessary arrangements for doing request-response SAAJ messaging. <strong>The</strong> two parties<br />

have agreed to exchange four kinds of XML messages and have set up the DTDs those<br />

messages will follow.<br />

2. <strong>The</strong> Coffee Break server requests price lists from each of the coffee suppliers. <strong>The</strong> server<br />

makes the appropriate remote web service calls and waits for the response, which is a<br />

<strong>Java</strong>Beans component representing a price list. <strong>The</strong> SAAJ supplier returns price lists as XML<br />

documents.<br />

3. Upon receiving the responses, the Coffee Break server processes the price lists from the<br />

<strong>Java</strong>Beans components returned by calls to the suppliers.<br />

4. <strong>The</strong> Coffee Break server creates a local database of suppliers.<br />

<strong>The</strong> <strong>Java</strong> <strong>EE</strong> 5<strong>Tutorial</strong> • June 2010

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!