websevice根据wsdl生成客户端代码

来源:互联网 发布:mac numbers 自动填充 编辑:程序博客网 时间:2024/06/05 19:23


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

C:\Users\zhangya>wsimport -d E:\temp -keep -verbose -p test http://localhost:8888/ns?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);}}


0 0
原创粉丝点击