首页 技术 正文
技术 2022年11月20日
0 收藏 436 点赞 2,934 浏览 1137 个字

方式一:

官网下载cxf运行包:http://cxf.apache.org/download.html

axis2:http://axis.apache.org/axis2/java/core/download.cgi

进入cxf的bin目录,cmd控制台运行:wsdl2java -d e:\ws\ http://219.139.241.227:8724/services/WMSPDAServices?wsdl

WebServices客户端代码生成

生成ws客户端代码。

附wsdl2java用法:

wsdl2java -p com -d D:\\src -all xx.wsdl

-p 指定其wsdl的命名空间,也就是要生成代码的包名:

-d 指定要产生代码所在目录

-client 生成客户端测试web service的代码

-server 生成服务器启动web service的代码

-impl 生成web service的实现代码

-ant 生成build.xml文件

-all 生成所有开始端点代码:types,service proxy,,service interface, server mainline, client mainline, implementation object, and an Ant build.xml file.

方式二:

maven项目pom.xml文件,配置以下插件:

  

<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.7.3</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>E:\workspaces\IdeaProjects\orderCenter\ordercenter-parent\ordercenter-job\src\main\java\com\ehaoyao\jobcenter\order\webservices\jyzx</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>http://****:***/services/WMSPDAServices?wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>clean install 即可生成ws客户端代码。调用测试:

WebServices客户端代码生成

WebServices客户端代码生成

接口存在问题。


    					
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,026
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,517
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,364
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,145
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,779
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,856