(1)ServiceFunction client = null;
(2)ServiceFunctionService service = new ServiceFunctionServiceLocator();
(3)client = service.getServiceFunction();
(4)client.helloFunction();
解释:
在(1)中的ServiceFunction是个接口,这个接口是最重要的,它里面的helloFunction()方法才是真正和服务器打交道的。(2)中的ServiceFunctionService也是个接口而ServiceFunctionServiceLocator是其实现类。(3)getServiceFunction()是接口中的方法返回类型是ServiceFunction。(4)helloFunction()这个方法是接口中的方法,其真正的实现类方法是在:ServiceFunctionSoapBindingStub这个类中。