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.

Examples: SecuringWeb Applications<br />

886<br />

Building and Deploying helloservice with Basic Authentication Using<br />

Ant<br />

To build, package, and deploy the jaxws/helloservice-basicauth example using the Ant<br />

tool, follow these steps, or the steps described in “Building, Packaging, and Deploying the<br />

Service” on page 480.<br />

1. If you have not already done so, set up your system for running the tutorial examples by<br />

following the instructions in “Building the Examples” on page 69.<br />

2. If you haven’t already done so, set up an authorized user on the Application Server, assigned<br />

to the group user, as described in “Managing Users and Groups on the Application Server”<br />

on page 779.<br />

3. From a terminal window or command prompt, go to the<br />

tut-install/javaeetutorial5/examples/jaxws/helloservice-basicauth/ directory.<br />

4. Build, package, and deploy the JAX-WS service by entering the following at the terminal<br />

window or command prompt in the helloservice-basicauth/ directory:<br />

ant all<br />

You can test the service by selecting it in the Admin Console and choosing Test. For more<br />

information on how to do this, read “Testing the Service without a Client” on page 482.<br />

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

Authentication Using NetBeans IDE<br />

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

these steps. <strong>The</strong> helloservice-basicauth service must be deployed onto the Application<br />

Server before compiling the client files. For information on deploying the service, read<br />

“Building and Deploying helloservice with Basic Authentication Using NetBeans IDE” on<br />

page 885.<br />

1. In NetBeans IDE, select File→Open Project.<br />

2. In the Open Project dialog, navigate to tut-install/javaeetutorial5/examples/jaxws/.<br />

3. Select the simpleclient-basicauth folder.<br />

4. Check the Open as Main Project and Open Required Projects check boxes.<br />

5. Click Open Project.<br />

6. In the Projects tab, right-click the simpleclient-basicauth project and select Clean and<br />

Build.<br />

7. In the Projects tab, right-click the simpleclient-basicauth project and select Run.<br />

You will be prompted for your user name and password.<br />

8. Enter the user name and password of a user that has been entered into the database of users<br />

for the file realm and has been assigned to the group of user.<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!