16.10.2015 Views

Getting Started with WebSphere Application Server

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

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

Chapter 7 – Web services 137<br />

HelloBillService service = new HelloBillService();<br />

HelloPeople bill = service.getHelloBillPort();<br />

out.println(bill.sayHello(target));<br />

}<br />

Listing 7.7 – The Servlet to consume Web Services<br />

- Resolve the type errors by adding:<br />

import com.ibm.wasce.samples.*;<br />

import java.io.*;<br />

4. Deploy and run the project in Community Edition<br />

- Right click the project and select Run As -> Run on <strong>Server</strong><br />

- In the popup, select Community Edition as the server runtime and check the<br />

check box Always use this server when running the project and then click<br />

Finish<br />

If the server is stopped, Community Edition will start automatically and deploy<br />

the project to run. Wait for some time until the server status changes to<br />

Synchronized, then a welcome page will appear as shown in Figure 7.7<br />

Figure 7.7 – Web client’s index page<br />

- Input Rex in the text box and press Submit. You should see the result as shown<br />

in Figure 7.8:

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

Saved successfully!

Ooh no, something went wrong!