现在webservice用的比较多的是xfire和axis,xfire主要是和spring结合来实现,也比较简单,service比较独立,只要在配置文件配置即可,下面说的是用wsdl2java来生成客户端
axis1 生成的是多个文件,有Soap11BindingStub和Soap12BindingStub,还有多个对应的request和response类等
axis2 生成的是两个文件
打开Eclipse,Run-->Open Run Dialog,在Main class框里 输入 WSDL2Java 进行搜索,前提是你的工程里已加入axis的jar包,会搜索到org.apache.axis.wsdl.WSDL2Java,在arguments标签栏里输入参数,默认基础目录为当前工程,src\\cfg\\test.wsdl -p com.test.outsys.prod.client -t 这是比较简单的生成客户端代码参数,运行就可以,刷新工程,会与src同级的地方出现com.test.outsys.prod.client之前设置的包名 ,复制到src下,详细参数在下面介绍,如果要生成服务端加入参数-s,生成后修改***Locator.java文件,修改里面的***HttpSoap11Endpoint_address及****HttpSoap12Endpoint_address为实际使用的地址即可,在程序里使用时可仿照***TestCase.java里写就可以。
以上介绍的是适合新入手webservice的朋友参考的
-h, --help
print this message and exit
-v, --verbose
print informational messages
-n, --noImports
only generate code for the immediate WSDL document
-O, --timeout <argument>
timeout in seconds (default is 45, specify -1 to disable)
-D, --Debug
print debug information
-W, --noWrapped
turn off support for "wrapped" document/literal
-q, --quiet
do not print any informational or debug messages (except err
ors)
-s, --server-side
emit server-side bindings for web service
-S, --skeletonDeploy <argument>
deploy skeleton (true) or implementation (false) in deploy.w
sdd. Default is false. Assumes --server-side.
-N, --NStoPkg <argument>=<value>
mapping of namespace to package
-f, --fileNStoPkg <argument>
file of NStoPkg mappings (default NStoPkg.properties)
-p, --package <argument>
override all namespace to package mappings, use this package
name instead
-o, --output <argument>
output directory for emitted files
-d, --deployScope <argument>
add scope to deploy.wsdd: "Application", "Request", "Session
"
-t, --testCase
emit junit testcase class for web service
-a, --all
generate code for all elements, even unreferenced ones
-T, --typeMappingVersion <argument>
indicate 1.1 or 1.2. The default is 1.1 (SOAP 1.1 JAX-RPC c
ompliant. 1.2 indicates SOAP 1.1 encoded.)
-F, --factory <argument>
name of a custom class that implements GeneratorFactory inte
rface (for extending Java generation functions)
-H, --helperGen
emits separate Helper classes for meta data
-B, --buildFile
emit Ant Buildfile for web service
-U, --user <argument>
username to access the WSDL-URI
-P, --password <argument>
password to access the WSDL-URI
-X, --classpath
additional classpath elements
-i, --nsInclude <argument>
include namespace in generated code
-x, --nsExclude <argument>
exclude namespace from generated code
-c, --implementationClassName <argument>
custom name of web service implementation
-u, --allowInvalidURL
emit file even if WSDL endpoint URL is not a valid URL
-w, --wrapArrays
Prefers building beans to straight arrays for wrapped XML ar
ray types (defaults to off).
分享到:
相关推荐
Eclipse根据wsdl文件逆向生成webservice客户端项目源码,包括wsdl文件,测试示例,测试webservice代码,包含备注信息
eclipse根据wsdl文件生成webservice客户端-图例.pdf
webService接口用eclipse工具WSDL生成服务端和客户端(http协议,xml构造传输),本人研究了好几天已成功,希望大家参考帖子少走弯路
webservice根据wsdl生成客户端代理类所需jar包,用Eclipse生成客户端代理类后所需jar包
axis2支持webservice 自动生成代码客户端服务端代码 基于eclipse
AXIS2 最新版本1.7.3针对 eclipse插件,一方面可以根据java接口类生成WSDL文件,另一方面可以根据WSDL生成客户端或服务端代码,生成的WSDL文件和代码符合web server SOAP协议规范标准!解压后的jar复制到Eclipse的...
第三种方式是利用axis2插件,将wsdl文件自动生成客户端代码,此种方式在myeclipse安装axis2.txt文件中已经做了详细介绍。 备注:资源超过了70M 分成了2部分 见axis2方式开发webservice(一)和 axis2方式开发...
第三种方式是利用axis2插件,将wsdl文件自动生成客户端代码,此种方式在myeclipse安装axis2.txt文件中已经做了详细介绍。 备注:资源超过了70M 分成了3部分 见axis2方式开发webservice(一)和 axis2方式开发...
webservice实例运用: 客户端调用webservice的方式: 1、通过wsimport生成客户端代码 2、通过客户端编程的方式调用 3、通过ajax调用js+xml 4、通过URLConnection调用
eclipse 工具通过axis2插件,根据wsdl生成webservice客户端代码。将此文件解压缩,放到%eclipse_home%\eclipse\plugins中,重启eclipse。然后选中项目,新建-other-axis2 wizards 下的axis2 code generate ,然后...
第三种方式是利用axis2插件,将wsdl文件自动生成客户端代码,此种方式在myeclipse安装axis2.txt文件中已经做了详细介绍。 备注:资源超过了70M 分成了3部分 见axis2方式开发webservice(一)和 axis2方式开发...
本文档从在eclipse下配置axis2开发环境,到编写服务器接口,使用axis2的...另一种是在要发布的类上使用右键-->webservice-->创建webservice,发布生成wsdl文件,编写客户端调用的方法的一些总结,希望能对大家有帮助。
cxf发布webservice,通过wsdl2java生成客户端,然后调用服务
CXF教程.doc Eclipse中用wsdl生成java客户端.docx java 利用Xfire 来生成Webservice 的WSDL文件 - 爱琴海 - ITeye技术网站.htm XFire部署开发webservice.docx XFire建立Webservice实例.doc XFire开发WebService详解....
如何使用eclipse针对wsdl生成服务器端代码和客户端代码的视频教程
这种方式发布的WebService并不需要我们生成WSDL,而直接从Bean生成WebService(自底向上模式)。典型的问题就是,如果我们直接用AXIS2中的源代码通过ant生成arr包发布的话,客户端可以正常的setWeather、getWeather...