WebService的5个方法如果来使用

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

 


 
 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值