首页 > 学院 > 开发设计 > 正文

websevice根据wsdl生成客户端代码

2019-11-08 02:20:12
字体:
来源:转载
供稿:网友


使用jdk自带的命令wsimport生成远程服务的本地代码

C:/Users/zhangya>wsimport -d E:/temp -keep -verbose -p test http://localhost:8888/ns?wsdl -keep -verbose -p test http://localhost:8888/ws01?wsdl-d <directory>       specify where to place generated output files(指定生成文件的路径)-verbose             output messages about what the compiler is doing(输出详细信息)-keep                keep generated files(生成java文件,不带此参数将只生成class文件)-p <pkg>             specifies the target package 生成代码的目标包

执行上面命令生成如下代码

编写测试类

package test;public class Test {	public static void main(String[] args) {		MyServiceipmlService msis = new MyServiceIpmlService();		IMyService ms = msis.getMyServiceIpmlPort();		ms.minus(10,1);	}	}


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表