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.

If the username and password you enter are authorized, you will see the output of the<br />

application client in the Output pane.<br />

<strong>The</strong> client displays the following output:<br />

[echo] running application client container.<br />

[exec] Retrieving the port from the following service:<br />

helloservice.basicauth.endpoint.HelloService@c8769b<br />

[exec] Invoking the sayHello operation on the port.<br />

[exec] Hello, No Name.<br />

Building and Running the helloservice Client Application with Basic<br />

Authentication Using Ant<br />

To build and run the client application, simpleclient-basicauth, using the Ant tool, follow<br />

these steps. <strong>The</strong> secured service must be deployed onto the Application Server before you can<br />

successfully compile the client application. For more information on deploying the service, read<br />

“Building and Deploying helloservice with Basic Authentication Using Ant” on page 886.<br />

1. Build the client by changing to the directory<br />

tut-install/examples/jaxws/simpleclient-basicauth/ and entering the following at the<br />

terminal window or command prompt:<br />

ant<br />

This command calls the default target, which builds and packages the application into a<br />

JAR file, simpleclient-basicauth.jar, located in the /dist directory.<br />

2. Run the client by entering the following at the terminal window or command prompt:<br />

ant run<br />

A Login for User dialog displays.<br />

3. Enter a user name and password that correspond to a user set up on the Application Server<br />

with a group of user. Click OK.<br />

<strong>The</strong> client displays the following output:<br />

[echo] running application client container.<br />

[exec] Retrieving the port from the following service:<br />

helloservice.basicauth.endpoint.HelloService@c8769b<br />

[exec] Invoking the sayHello operation on the port.<br />

[exec] Hello, No Name.<br />

Examples: SecuringWeb Applications<br />

Chapter 30 • SecuringWeb Applications 887

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

Saved successfully!

Ooh no, something went wrong!