Fork me on GitHub

jaxws:wsimport

Full name:

org.codehaus.mojo:jaxws-maven-plugin:2.6:wsimport

Description:

Parses wsdl and binding files and generates Java code needed to access it.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: runtime.
  • Binds by default to the lifecycle phase: generate-sources.

Optional Parameters

Name Type Since Description
<args> List - Specify optional command-line options.

Multiple elements can be specified, and each token must be placed in its own list.


<bindingDirectory> File - Directory containing binding files.
Default value is: ${project.basedir}/src/jaxws.
<bindingFiles> List - List of files to use for bindings. If not specified, all .xml files in the bindingDirectory will be used.
<catalog> File - Catalog file to resolve external entity references support TR9401, XCatalog, and OASIS XML Catalog format.
<destDir> File - Specify where to place output generated classes. Use xnocompile to turn this off.
Default value is: ${project.build.outputDirectory}.
<encoding> String - Specify character encoding used by source files.
Default value is: ${project.build.sourceEncoding}.
<executable> File 2.2.1 Path to the executable. Should be either wsgen or wsimport but basically any script which will understand passed in arguments will work.
<extension> boolean - Allow to use the JAXWS Vendor Extensions.
Default value is: false.
<genJWS> boolean - Generate stubbed JWS implementation file.
Default value is: false.
<httpproxy> String - Set HTTP/HTTPS proxy. Format is [user[:password]@]proxyHost[:proxyPort].
<implDestDir> File - Specify where to generate JWS implementation file.
Default value is: ${project.build.sourceDirectory}.
<implPortName> String - Local portion of port name for generated JWS implementation. Implies genJWS=true. Note: It is a QName string, formatted as: "{" + Namespace URI + "}" + local part
<implServiceName> String - Local portion of service name for generated JWS implementation. Implies genJWS=true. Note: It is a QName string, formatted as: "{" + Namespace URI + "}" + local part
<keep> boolean - Keep generated files.
Default value is: true.
<packageName> String - The package in which the source files will be generated.
<quiet> boolean - Suppress wsimport output.
Default value is: false.
<sourceDestDir> File - Specify where to place generated source files, keep is turned on with this option.
Default value is: ${project.build.directory}/generated-sources/wsimport.
<staleFile> File - The folder containing flag files used to determine if the output is stale.
Default value is: ${project.build.directory}/jaxws/stale.
<target> String - Generate code as per the given JAXWS specification version. Setting "2.0" will cause JAX-WS to generate artifacts that run with JAX-WS 2.0 runtime.
<useJdkToolchainExecutable> boolean 2.4 If a JDK toolchain is found, by default, it is used to get java executable with its tools.jar. But if set to true, it is used it to find wsgen and wsimport executables.
Default value is: false.
<verbose> boolean - Output messages about what the tool is doing.
Default value is: false.
<vmArgs> List - Specify optional JVM options.

Multiple elements can be specified, and each token must be placed in its own list.


<wsdlDirectory> File - Directory containing WSDL files.
Default value is: ${project.basedir}/src/wsdl.
<wsdlFiles> List - List of files to use for WSDLs. If not specified, all .wsdl files in the wsdlDirectory will be used.
<wsdlLocation> String - @WebService.wsdlLocation and @WebServiceClient.wsdlLocation value.

Can end with asterisk in which case relative path of the WSDL will be appended to the given wsdlLocation.

Example:

 ...
 <configuration>
     <wsdlDirectory>src/mywsdls</wsdlDirectory>
     <wsdlFiles>
         <wsdlFile>a.wsdl</wsdlFile>
         <wsdlFile>b/b.wsdl</wsdlFile>
         <wsdlFile>${project.basedir}/src/mywsdls/c.wsdl</wsdlFile>
     </wsdlFiles>
     <wsdlLocation>http://example.com/mywebservices/*</wsdlLocation>
 </configuration>
 ...
wsdlLocation for a.wsdl will be http://example.com/mywebservices/a.wsdl
wsdlLocation for b/b.wsdl will be http://example.com/mywebservices/b/b.wsdl
wsdlLocation for ${project.basedir}/src/mywsdls/c.wsdl will be file://absolute/path/to/c.wsdl

Note: External binding files cannot be used if asterisk notation is in place.


<wsdlUrls> List - List of external WSDL URLs to be compiled.
<xadditionalHeaders> boolean - Maps headers not bound to the request or response messages to Java method parameters.
Default value is: false.
<xauthFile> File - Specify the location of authorization file.
<xdebug> boolean - Turn on debug message.
Default value is: false.
<xdisableAuthenticator> boolean - Disable Authenticator used by JAX-WS RI, xauthfile will be ignored if set.
Default value is: false.
<xdisableSSLHostnameVerification> boolean - Disable the SSL Hostname verification while fetching WSDL(s).
Default value is: false.
<xjcArgs> List - Specify optional XJC-specific parameters that should simply be passed to xjc using -B option of WsImport command.

Multiple elements can be specified, and each token must be placed in its own list.


<xnoAddressingDataBinding> boolean - Binding W3C EndpointReferenceType to Java. By default WsImport follows spec and does not bind EndpointReferenceType to Java and uses the spec provided W3CEndpointReference
Default value is: false.
<xnocompile> boolean - Turn off compilation after code generation and let generated sources be compiled by maven during compilation phase; keep is turned on with this option.
Default value is: true.
<xuseBaseResourceAndURLToLoadWSDL> boolean - If set, the generated Service classes will load the WSDL file from a URL generated from the base resource.
Default value is: false.

Parameter Details

<args>

Specify optional command-line options.

Multiple elements can be specified, and each token must be placed in its own list.

  • Type: java.util.List
  • Required: No

<bindingDirectory>

Directory containing binding files.
  • Type: java.io.File
  • Required: No
  • Default: ${project.basedir}/src/jaxws

<bindingFiles>

List of files to use for bindings. If not specified, all .xml files in the bindingDirectory will be used.
  • Type: java.util.List
  • Required: No

<catalog>

Catalog file to resolve external entity references support TR9401, XCatalog, and OASIS XML Catalog format.
  • Type: java.io.File
  • Required: No

<destDir>

Specify where to place output generated classes. Use xnocompile to turn this off.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.outputDirectory}

<encoding>

Specify character encoding used by source files.
  • Type: java.lang.String
  • Required: No
  • Default: ${project.build.sourceEncoding}

<executable>

Path to the executable. Should be either wsgen or wsimport but basically any script which will understand passed in arguments will work.
  • Type: java.io.File
  • Since: 2.2.1
  • Required: No

<extension>

Allow to use the JAXWS Vendor Extensions.
  • Type: boolean
  • Required: No
  • Default: false

<genJWS>

Generate stubbed JWS implementation file.
  • Type: boolean
  • Required: No
  • Default: false

<httpproxy>

Set HTTP/HTTPS proxy. Format is [user[:password]@]proxyHost[:proxyPort].
  • Type: java.lang.String
  • Required: No

<implDestDir>

Specify where to generate JWS implementation file.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.sourceDirectory}

<implPortName>

Local portion of port name for generated JWS implementation. Implies genJWS=true. Note: It is a QName string, formatted as: "{" + Namespace URI + "}" + local part
  • Type: java.lang.String
  • Required: No

<implServiceName>

Local portion of service name for generated JWS implementation. Implies genJWS=true. Note: It is a QName string, formatted as: "{" + Namespace URI + "}" + local part
  • Type: java.lang.String
  • Required: No

<keep>

Keep generated files.
  • Type: boolean
  • Required: No
  • Default: true

<packageName>

The package in which the source files will be generated.
  • Type: java.lang.String
  • Required: No

<quiet>

Suppress wsimport output.
  • Type: boolean
  • Required: No
  • Default: false

<sourceDestDir>

Specify where to place generated source files, keep is turned on with this option.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/generated-sources/wsimport

<staleFile>

The folder containing flag files used to determine if the output is stale.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/jaxws/stale

<target>

Generate code as per the given JAXWS specification version. Setting "2.0" will cause JAX-WS to generate artifacts that run with JAX-WS 2.0 runtime.
  • Type: java.lang.String
  • Required: No

<useJdkToolchainExecutable>

If a JDK toolchain is found, by default, it is used to get java executable with its tools.jar. But if set to true, it is used it to find wsgen and wsimport executables.
  • Type: boolean
  • Since: 2.4
  • Required: No
  • Default: false

<verbose>

Output messages about what the tool is doing.
  • Type: boolean
  • Required: No
  • Default: false

<vmArgs>

Specify optional JVM options.

Multiple elements can be specified, and each token must be placed in its own list.

  • Type: java.util.List
  • Required: No

<wsdlDirectory>

Directory containing WSDL files.
  • Type: java.io.File
  • Required: No
  • Default: ${project.basedir}/src/wsdl

<wsdlFiles>

List of files to use for WSDLs. If not specified, all .wsdl files in the wsdlDirectory will be used.
  • Type: java.util.List
  • Required: No

<wsdlLocation>

@WebService.wsdlLocation and @WebServiceClient.wsdlLocation value.

Can end with asterisk in which case relative path of the WSDL will be appended to the given wsdlLocation.

Example:

 ...
 <configuration>
     <wsdlDirectory>src/mywsdls</wsdlDirectory>
     <wsdlFiles>
         <wsdlFile>a.wsdl</wsdlFile>
         <wsdlFile>b/b.wsdl</wsdlFile>
         <wsdlFile>${project.basedir}/src/mywsdls/c.wsdl</wsdlFile>
     </wsdlFiles>
     <wsdlLocation>http://example.com/mywebservices/*</wsdlLocation>
 </configuration>
 ...
wsdlLocation for a.wsdl will be http://example.com/mywebservices/a.wsdl
wsdlLocation for b/b.wsdl will be http://example.com/mywebservices/b/b.wsdl
wsdlLocation for ${project.basedir}/src/mywsdls/c.wsdl will be file://absolute/path/to/c.wsdl

Note: External binding files cannot be used if asterisk notation is in place.

  • Type: java.lang.String
  • Required: No

<wsdlUrls>

List of external WSDL URLs to be compiled.
  • Type: java.util.List
  • Required: No

<xadditionalHeaders>

Maps headers not bound to the request or response messages to Java method parameters.
  • Type: boolean
  • Required: No
  • Default: false

<xauthFile>

Specify the location of authorization file.
  • Type: java.io.File
  • Required: No

<xdebug>

Turn on debug message.
  • Type: boolean
  • Required: No
  • Default: false

<xdisableAuthenticator>

Disable Authenticator used by JAX-WS RI, xauthfile will be ignored if set.
  • Type: boolean
  • Required: No
  • Default: false

<xdisableSSLHostnameVerification>

Disable the SSL Hostname verification while fetching WSDL(s).
  • Type: boolean
  • Required: No
  • Default: false

<xjcArgs>

Specify optional XJC-specific parameters that should simply be passed to xjc using -B option of WsImport command.

Multiple elements can be specified, and each token must be placed in its own list.

  • Type: java.util.List
  • Required: No

<xnoAddressingDataBinding>

Binding W3C EndpointReferenceType to Java. By default WsImport follows spec and does not bind EndpointReferenceType to Java and uses the spec provided W3CEndpointReference
  • Type: boolean
  • Required: No
  • Default: false

<xnocompile>

Turn off compilation after code generation and let generated sources be compiled by maven during compilation phase; keep is turned on with this option.
  • Type: boolean
  • Required: No
  • Default: true

<xuseBaseResourceAndURLToLoadWSDL>

If set, the generated Service classes will load the WSDL file from a URL generated from the base resource.
  • Type: boolean
  • Required: No
  • Default: false