通过wsdl生成client 的几种方式
wsimport
位置
%JAVA_HOME%/bin/wsimport.exe
帮助
wsimport -help
Usage: wsimport [options] <WSDL_URI> where [options] include:
-b <path> specify jaxws/jaxb binding files or additional schemas
(Each <path> must have its own -b)
-B<jaxbOption> Pass this option to JAXB schema compiler
-catalog <file> specify catalog file to resolve external entity references
supports TR9401, XCatalog, and OASIS XML Catalog format.
-d <directory> specify where to place generated output files
-extension allow vendor extensions - functionality not specified
by the specification. Use of extensions may
result in applications that are not portable or
may not interoperate with other implementations
-help display help
-httpproxy:<host>:<port> specify a HTTP proxy server (port defaults to )
-keep keep generated files
-p <pkg> specifies the target package
-quiet suppress wsimport output
-s <directory> specify where to place generated source files
-target <version> generate code as per the given JAXWS spec version
Defaults to 2.2, Accepted values are 2.0, 2.1 and 2.2
e.g. 2.0 will generate compliant code for JAXWS 2.0 spec
-verbose output messages about what the compiler is doing
-version print version information
-wsdllocation <location> @WebServiceClient.wsdlLocation value
-clientjar <jarfile> Creates the jar file of the generated artifacts along with the
WSDL metadata required for invoking the web service. Extensions:
-XadditionalHeaders map headers not bound to request or response message to
Java method parameters
-Xauthfile file to carry authorization information in the format
http://username:password@example.org/stock?wsdl
-Xdebug print debug information
-Xno-addressing-databinding enable binding of W3C EndpointReferenceType to Java
-Xnocompile do not compile generated Java files
-XdisableSSLHostnameVerification disable the SSL Hostname verification while fetching
wsdls Examples:
wsimport stock.wsdl -b stock.xml -b stock.xjb
wsimport -d generated http://example.org/stock?wsdl
语法
Usage: wsimport [options] <WSDL_URI>
常用选项
-d <directory> specify where to place generated output files 指定文件输出路径(需存在不能自动生成)
-keep keep generated files 保留.java 文件(不同于wsdl2java 中的keep)
例子
wsimport -d E:/wscode -keep http://localhost:8080/HelloServic?wsdl
wsdl2java
位置
%CXF_HOME%/bin/wsdl2java.bat
帮助
wsdl2java -help
wsdl2java -fe|-frontend <front-end-name> -db|-databinding <data-binding-name> -wv <wsdl-version> -p <[wsdl-namespace =]p
ackage-name>* -sn <service-name> -b <binding-file-name>* -reserveClass <class-name>* -catalog <catalog-file-name> -d <ou
tput-directory> -compile -classdir <compile-classes-directory> -impl -server -client -clientjar <jar-file-name> -all -au
toNameResolution -allowElementReferences|-aer<=true> -defaultValues<=class-name-for-DefaultValueProvider> -ant -nexclude
<schema-namespace [= java-package-name]>* -exsh <(true, false)> -noTypes -dns <Default value is true> -dex <(true, fals
e)> -validate<[=all|basic|none]> -keep -wsdlLocation <wsdlLocation> -xjc<xjc-arguments>* -asyncMethods<[=method1,method2
,...]>* -bareMethods<[=method1,method2,...]>* -mimeMethods<[=method1,method2,...]>* -noAddressBinding -faultSerialVersio
nUID <fault-serialVersionUID> -encoding <encoding> -exceptionSuper <exceptionSuper> -seiSuper <seiSuper>* -mark-generate
d -h|-?|-help -version|-v -verbose|-V -quiet|-q|-Q -wsdlList <wsdlurl> Options: -fe|-frontend <front-end-name>
Specifies the front end. (defaults to JAXWS) -db|-databinding <data-binding-name>
Specifies the data binding. (defaults to JAXB) -wv <wsdl-version>
Specifies the WSDL version. (default is WSDL1.) -p <[wsdl-namespace =]package-name>*
Specifies the java package name to use for the generated
code. Optionally specify a WSDL namespace to Java package
name mapping. -sn <service-name>
Specify he WSDL service name to use for the generated code.
Also, optionally specify the WSDL namespace. -b <binding-file-name>*
Specify an external jaxws or jaxb binding files. Use one -b
flag for each binding file. -reserveClass <class-name>*
Reserve a class name to keep the code generator from
generating a class of the given name. In name cases, a
binding file or use of -autoNameResolution flag may be
necessary for the code generator to completely generate
usable code. -catalog <catalog-file-name>
Specify catalog file to map the imported wsdl/schema. -d <output-directory>
Specify the directory into which the code is placed. -compile Specifies that the generated code is compiled by the tool. -classdir <compile-classes-directory>
Specifies the directory into which compiled class files are
placed. -impl Specifies that a dummy service implementation is generated. -server Specifies that server code is generated. -client Specifies that client code is generated. -clientjar <jar-file-name>
Package all the client classes and wsdl in a jar file -all Specifies that interfaces, types , service, server , dummy
impl, client and ant script are generated. -autoNameResolution
Specifies that the tool will attempt to resolve class
naming conflicts without requiring the use of binding
customizations. -allowElementReferences|-aer<=true>
allowElementReferences -defaultValues<=class-name-for-DefaultValueProvider>
Specifies that default values are generated for the dummy
implementation and client. You can specify the name of the
class to provide the default values. The default is
RandomValueProvider. -ant Specifies that an ant build script is generated for the
project. -nexclude <schema-namespace [= java-package-name]>*
Specifies a WSDL namespace to exclude when generating code.
This option can be specified multiple times. Optionally
specify the Java package name to use for the WSDL
namespace. -exsh <(true, false)>
Enables the processing of extended SOAP header message
binding. -noTypes Turns off generating types -dns <Default value is true>
Enables loading the default namespace package name mapping.
The default is true. -dex <(true, false)>
Enable loading the default excludes namespace mapping. The
default is true. -validate<[=all|basic|none]>
Specifies that the WSDL is validated before generating the
code. Using this option is highly recommended. By default,
only very basic validation is done to make sure the WSDL
meets the WSI-BasicProfile standards that CXF requires.
-validate=none can turn off those checks while -validate or
-validate=all turns on additional schema validation and
other checks. -keep Specifies that existing code will not be over written.
NOTE: You will have to solve any resulting compilation
problems by yourself -wsdlLocation <wsdlLocation>
Specifies the value of the @WebServiceClient annotation's
wsdlLocation property. -xjc<xjc-arguments>*
Specifies a comma separated list of arguments that are
passed directly to XJC when the JAXB data binding is used.
This option causes XJC to load additional plugins that
augment code generation. For example to load the
toString(ts) plugin that will add a toString() method to
all generated types the following <xjc arguments> would be
used: -xjc-Xts A list of available XJC plugins can be
obtained by using -xjc-X. -asyncMethods<[=method1,method2,...]>*
Specifies a comma separated list of methods that should
have asynchronous version generated in addition to the
normal synchronous versions. If no methods are listed, all
methods are generated with asynchronous versions. -bareMethods<[=method1,method2,...]>*
Specifies a comma separated list of methods that should not
be unwrapped into individual parameters and instead be left
in their "bare" form. -mimeMethods<[=method1,method2,...]>*
Specifies a comma separated list of methods where the
mime:content information is used to generate the type. -noAddressBinding Specifies that the generator should not use the address
jaxb binding file to map wsa:EndpointReferenceType or
wsa:EndpointReference to
javax.xml.ws.wsaddressing.W3CEndpointReference. -faultSerialVersionUID <fault-serialVersionUID>
Specifies how to generate fault Exception's SUID, can use
NONE|TIMESTAMP|FQCN|####", the default is NONE. FQCN uses a
hash of the fully qualified class name. #### would be any
valid Long to use as the SUID. -encoding <encoding>
Specifies the charset encoding to use when generating java
sources -exceptionSuper <exceptionSuper>
Specifies the superclass to use for generated exceptions,
the default is java.lang.Exception. -seiSuper <seiSuper>*
Specifies the SuperInterface to use for generated Service
Interfaces. -mark-generated Adds @Generated annotation in all java files that are
generated. -h|-?|-help Display detailed information for options. -version|-v Display the version of the tool. -verbose|-V Specifies that the generator runs in verbose mode. -quiet|-q|-Q Specifies that the generator runs in quiet mode. -wsdlList Indicates the wsdlurl is a plain text list of wsdlurls that
are new line delimited. As an example the wsdlurl might
point to
http://127.0.0.1:8080/context_path/ws?formatted=false&wsdlL
ist=true on a cxf server. <wsdlurl> wsdl-url
语法
Usage : wsdl2java [options] <wsdlurl>
常用选项
-d output-directory Specifies the directory into which the generated code files are written. 存放.java文件和.jar 文件,自动生成。
-compile Compiles generated Java files. 开启compile命令后产生class文件,classdir会把这些文件分离。
-classdir compile-class-dir Specifies the directory into which the compiled class files are written. 分离由compile产生的class文件,文件夹可自动。
-client Generates starting point code for a client mainline. 一类,还有server 和 impl 等。
-clientjar jar-file-name Generates the jar file which contains all the client classes and wsdl;... 不受compile影响。
例子
wsdl2java -d E:/wscode -compile -classdir E:/wsclass -client -clientjar myclient.jar http://localhost:8080/HelloServic?wsdl
通过wsdl生成client 的几种方式的更多相关文章
- python 全栈开发,Day94(Promise,箭头函数,Django REST framework,生成json数据三种方式,serializers,Postman使用,外部python脚本调用django)
昨日内容回顾 1. 内容回顾 1. VueX VueX分三部分 1. state 2. mutations 3. actions 存放数据 修改数据的唯一方式 异步操作 修改state中数据的步骤: ...
- Pandas 基础(3) - 生成 Dataframe 的几种方式
这一节想总结一下 生成 Dataframe 的几种方式: CSV Excel python dictionary List of tuples List of dictionary 下面分别一一介绍具 ...
- 数据可视化之powerBI技巧(七)从Excel到PowerBI,生成笛卡尔积的几种方式
假如分别有100个不重复的姓和名,把每个姓和名进行组合匹配,就可以得到一万个不重复的姓名组合,这种完全匹配的方式就是生成一个姓名的笛卡尔积. 下面就来看看生成笛卡尔积的几种方式,为了展现的方便,以5个 ...
- spring生成EntityManagerFactory的三种方式
spring生成EntityManagerFactory的三种方式 1.LocalEntityManagerFactoryBean只是简单环境中使用.它使用JPA PersistenceProvide ...
- php 生成word的三种方式
原文地址 http://www.jb51.net/article/97253.htm 最近工作遇到关于生成word的问题 现在总结一下生成word的三种方法. btw:好像只要是标题带PHP的貌似点击 ...
- Android 生成LayoutInflater的三种方式
通俗的说,inflate就相当于将一个xml中定义的布局找出来. 因为在一个Activity里如果直接用findViewById()的话,对应的是setConentView()的那个layout里的组 ...
- 使用NVelocity生成内容的几种方式
使用NVelocity也有几个年头了,主要是在我的代码生成工具Database2Sharp上使用来生成相关代码的,不过NVelocity是一个非常不错的模板引擎,可以用来生成文件.页面等相关处理,非常 ...
- PHP生成word的三种方式
摘要: 最近工作遇到关于生成word的问题 现在总结一下生成word的三种方法. btw:好像在博客园发表博客只要是标题带PHP的貌似点击量都不是很高(哥哥我标题还是带上PHP了),不知道为什么,估计 ...
- 利用"SQL"语句自动生成序号的两种方式
1.首先,我们来介绍第一种方式: ◆查询的SQL语句如下: select row_number() over (order by name) as rowid, sysobjects.[id] fro ...
随机推荐
- c++ cout cin, 命名空间
cout<<a<<endl; cout<<a; 返回值其实就是一个输出流,(cout就是输出流) 上述语句等价于(cout<<a)<<end ...
- POST方式"Content-type"是"application/x-www-form-urlencoded 的请求遇到的问题
Content-type的方式:application/x-javascript text/xml->xml数据 application/x-javascript->json对象 appl ...
- Linq相关
Linq(语言集成查询) 相关资料如下: 1. Linq语言集成查询 百度百科 2. 30分钟Linq教程 3. Linq查询表达式(C#编程指南) 4. Linq十个常用查询 5. Linq技术专题 ...
- JAVA 模拟瞬间高并发
如何模拟一个并发?当时我的回答虽然也可以算是正确的,但自己感觉缺乏实际可以操作的细节,只有一个大概的描述. 当时我的回答是:“线程全部在同一节点wait,然后在某个节点notifyAll.” 面试官: ...
- fabric应用
安装: easy_install fabric 或 pip install fabric 验证: #python >>> import fabric 有时候我们可以直接使用命令行的 ...
- Mysql Innodb 性能参数设置 https://www.rathishkumar.in/2017/01/how-to-allocate-innodb-buffer-pool-size-in-mysql.html
参考原文: https://www.rathishkumar.in/2017/01/how-to-allocate-innodb-buffer-pool-size-in-mysql.html 查看系统 ...
- poj3186(区间DP)
题目链接:http://poj.org/problem?id=3186 思路: 区间DP,给treat编号为1..n,状态很明显是上界i和下界j,dp[i][j]表示从下标i到下标j之间数据的最大价值 ...
- JdbcTemplate实现CRUD操作
------------------siwuxie095 JdbcTemplate 实现 CRUD 操作 1.J ...
- 给出一个十六进制的数0xFF 0x80 (只有2“位”) 将其转换成有符号的一字节的十进制整数
#include <stdio.h>#include<iostream>#include <stdlib.h>#include<string.h>usi ...
- [leetcode]277. Find the Celebrity谁是名人
Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist o ...