Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Create a client Java class hellowsclient.HelloWSClient. In the Java client application, create an instance of the HelloWSService service:
hellows.HelloWSService service=new HelloWSService();
The Service class will be created during the build, which is explained later. Obtain a proxy to the service from the service using the getHelloWSPort() method:
hellows.HelloWS port = service.getHelloWSPort();
Invoke the hello(String) method of the service using the service proxy:
String result = port.hello("John Smith.");
Output the result of the web service method invocation. The Java client class is listed as follows:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package hellowsclient;
/**
*
* @author dvohra
*/
import hellows.*;
public class HelloWSClient {
/**
* @param args
*/
public static void main(String[] args) {
hellows.HelloWSService service = new hellows.HelloWSService();
hellows.HelloWS port = service.getHelloWSPort();
String result = port.hello("John Smith.");
System.out.println(result);
client classcreating}
}