16.10.2015 Views

Getting Started with WebSphere Application Server

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7 – Web services 131<br />

Figure 7.2 – Message from the Axis2 engine<br />

And you can get the WSDL file generated by Geronimo from the following location:<br />

http://localhost:8080/HelloServiceProject/Hello?wsdl<br />

7.3 Consuming a Web Service deployed in Community Edition<br />

To test and invoke (consume) a Web service from a client, follow these steps:<br />

1. Review the WSDL from a browser, and use jaxws-tools to generate stub classes.<br />

2. Import stubs into your client application.<br />

3. Construct a Service object through the stubs, and get the target port object from<br />

the service; then, invoke the methods on the port object.<br />

This section will show you how to create a POJO client and a Web-based client for a Web<br />

service. You only need the WSDL file of the Web service deployed for creating the client.<br />

7.3.1 Creating necessary stubs to consume the Web Service<br />

You need to create a Service Endpoint Interface based on the WSDL document by using<br />

the JAX-WS tool wsimport. The syntax to use this tool is:<br />

wsimport [options] <br />

Common options of wsimport are shown in Table 7.1:

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

Saved successfully!

Ooh no, something went wrong!