webService快速入门入门系列《2》--本地调用

来源:互联网 发布:逆战刷枪软件下载 编辑:程序博客网 时间:2024/06/06 02:43

生成本地jar包的形式来调用
这里写图片描述

这里写图片描述

client.java

public class Client {    public static void main(String[] args) {        TestImplService testImplService = new TestImplService();        Test1 testImplPort = testImplService.getTestImplPort();        int add = testImplPort.add(11, 22);        System.out.println(add);    }}

说明一下:
一般生成本地java文件会出现xxxxService();这个文件,xxxx是指你的接口实现类的名字,这个类相当于一个工厂,然后有getxxxxPort()这个方法得到一个代理类,这个类才可以调用服务器那边的方法。

原创粉丝点击