wsdl2java.bat详细使用指南 (二)

2014-11-24 10:43:45 · 作者: · 浏览: 2
cit SOAP headers (i.e. SOAP headers defined in the wsdl:binding but not wsdl:portType section.) Processing the SOAP headers requires the SOAP binding jars available on the classpath which was not the default in CXF 2.4.x and older. You may need to add a dependency to cxf-rt-binding-soap for this flag to work. Default is false.
-dns (true/false) Enables or disables the loading of the default namespace package name mapping. Default is true andhttp://www.w3.org/2005/08/addressing=org.apache.cxf.ws.addressing namespace package mapping will be enabled.
-dex (true/false) Enables or disables the loading of the default excludes namespace mapping. Default is true.
-validate Enables validating the WSDL before generating the code.
-keep Specifies that the code generator will not overwrite any preexisting files. You will be responsible for resolving any resulting compilation issues.
-wsdlLocation wsdlLocation Specifies the value of the @WebServiceClient annotation's wsdlLocation property.
-xjc Specifies a comma separated list of arguments that are passed directly to the XJC processor when using the JAXB databinding. A list of available XJC plugins can be obtained using -xjc-X.
-noAddressBinding For compatibility with CXF 2.0, this flag directs the code generator to generate the older CXF proprietary WS-Addressing types instead of the JAX-WS 2.1 compliant WS-Addressing types.
-v Displays the version number for the tool.
-verbose Displays comments during the code generation process.
-quiet Suppresses comments during the code generation process.
-exceptionSuper superclass for fault beans generated from wsdl:fault elements (defaults to java.lang.Exception)
-reserveClass classname Used with -autoNameResolution, defines a class names for wsdl-to-java not to use when generating classes. Use this option multiple times for multiple classes.
-allowElementReferences<=true> (or -aer) If true, disregards the rule given in section 2.3.1.2(v) of the JAX-WS 2.2 specification disallowing element references when using wrapper-style mapping.
-asyncMethods=foo,bar,... List of subsequently generated Java class methods to allow for client-side asynchronous calls, similar to enableAsyncMapping in a JAX-WS binding file.
-bareMethods=foo,bar,... List of subsequently generated Java class methods to have wrapper style (see below), similar to enableWrapperStyle in JAX-WS binding file.
-mimeMethods=foo,bar,... List of subsequently generated Java class methods to enable mime:content mapping, similar to enableMIMEContent in JAX-WS binding file.
-faultSerialVersionUID How to generate suid of fault exceptions. Use NONE, TIMESTAMP, FQCN, or a specific number. Default is NONE.
-mark-generated Adds the @Generated annotation to classes generated.
wsdlurl The path and name of the WSDL file to use in generating the code.

You must specify the absolute or relative path to the WSDL document as the last argument.


Examples
wsdl2java HelloWorld.wsdl

wsdl2java -p com.mycompany.greeting Greeting.wsdl

wsdl2java -client HelloWorld.wsdl

wsdl2java -uri http://localhost:8080/axis2/services/SimpleService wsdl -p client -s -o stub


(See below for usage with Apache Ant and Maven.)

Using wsdl2java with Ant
The wsdl2java command can be wrapped inside an Ant target as shown below:

< xml version="1.0" >



















Make sure you set the "fork=true" attribute for the task as shown above. Also, rem