(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这个类中。

本文介绍了通过ServiceFunction接口调用helloFunction方法的过程。首先创建ServiceFunctionServiceLocator实例,然后通过getServiceFunction方法获取ServiceFunction接口实例,最后调用helloFunction方法实现与服务器交互。
277

被折叠的 条评论
为什么被折叠?



