Java Reference
In-Depth Information
Start
End
Figure 4-17 . Activities for Creating a Web Service Client
4.6.1 Creating Client Stub with wsimport
Writing a SOAP client with SAAJ can be complex and time-consuming. See section 2.4
for details. Instead, we will use the wsimport tool to generate WS artifacts (stubs).
First, create a Java Project under Eclipse IDE and call it 'java-ws-client'
.
1.
At the command prompt, go to the Java Project for Eclipse called 'java-ws-client'
.
2.
Create a folder called 'generated'
.
3.
To generate WS stubs, run the following commands:
wsimport -d . http://localhost:9999/doc/em-
ployees?WSDL wsimport -d . http://localhost:9999/rpc/
employees?WSDL wsimport -d . http://localhost:9999/
java-ws/hello?WSDL
4.
To create a Java library, run the following command:
jar-cvf ../lib/java-ws-generated.jar *
5.
To verify the content of the created jar, run this command:
jar-tf ../lib/java-ws-generated.jar *
Search WWH ::




Custom Search