接下去学习的是wsimport这个命令
这个命令使得我们可以换其他方式调用接口并调用服务
具体步骤:
1.首先切换至要生成文件的目录
命令提示符 d:回车
2.wsimport -d d:/webservice/01/ -keep -verbose http://localhost:9999/service?wsdl
然后在上述描述目录生成CLASS文件以及源文件
我们复制这个01下的文件夹在新的项目中就能采用如下代码调用接口
package com.lanccj.service; public class TestClient2 { public static void main(String[] args) { WebserviceService wss=new WebserviceService(); IWebservice iws=wss.getWebservicePort(); System.out.println(iws.hello()); } }