Java Reference
In-Depth Information
1.8.1 Create a Project
1.8.2 Generate Web Service Stub
First, a generated WS client code is generated using a readily available tool, wsimport,
from the Java JDK package. Second, a client code is written using the generated code.
1. Open a command prompt or a Unix terminal.
2. Go to the java-ws-client project directory.
3. Create a 'generated' directory.
4. Create a 'lib' directory.
5. Go to the 'generated' directory.
6. Run the following command:
wsimport -d . http://localhost:9999/java-ws/hello?wsdl
7. Package the generated client code:
jar cvf ../java-ws-generated.jar *
8. Move the java-ws-generated.jar file to the 'lib' directory.
1.8.3
Create Web Service Client
9.
Return to Eclipse and refresh the Java project:
a) Choose java-ws project.
b) Choose File Refresh.
c)
From project properties, choose Java Build Path/Libraries.
d)
Click on Add JARs and add the java-ws-generated.jar file.
e)
Click OK.
10.
Create a new Java package: com.bemach.ws.hello.client.
11.
Create a new Java class: HelloWorldClient.java.
Search WWH ::




Custom Search