1.0 Version
Usage: java org.apache.axis.wsdl.WSDL2Java [options] WSDL-URI
Options:
-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
-s, --server-side
emit server-side bindings for web service
-S, --skeletonDeploy <argument>
deploy skeleton (true) or implementation (false) in deploy.wsdd.
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.xml: "Application", "Request", "Session"
-t, --testCase
emit junit testcase class for web service
-a, --all
generate code for all elements, even unreferenced ones
-T, --typeMappingVersion
indicate 1.1 or 1.2. The default is 1.1 (SOAP 1.1 JAX-RPC compliant.
1.2 indicates SOAP 1.1 encoded.)
-F, --factory <argument>
name of a custom class that implements GeneratorFactory interface
(for extending Java generation functions)
-H, --helperGen
emits separate Helper classes for meta data
-U, --user <argument>
username to access the WSDL-URI
-P, --password <argument>
password to access the WSDL-URI
<service name="AddressBook" provider="java:RPC"> <parameter name="className" value="samples.addr.AddressBookSOAPBindingSkeleton"/> ... </service>
and for "false" it would look like:
<service name="AddressBook" provider="java:RPC"> <parameter name="className" value="samples.addr.AddressBookSOAPBindingImpl"/> ... </service>
The default for this option is false. When you use this option, the --server-side option is assumed, so you don't have to explicitly specify --server-side as well.
--NStoPkg urn:AddressFetcher2=samples.addr(Note that if you use the short option tag, "-N", then there must not be a space between "-N" and the namespace.)
The entries in this file are of the same form as the arguments to the --NStoPkg command line option. For example, instead of providing the command line option as above, we could provide the same information in NStoPkg.properties:
urn\:AddressFetcher2=samples.addr(Note that the colon must be escaped in the properties file.)
If an entry for a given mapping exists both on the command line and in the properties file, the command line entry takes precedence.
A note about what it means to be referenced. We cannot simply say:
start with the services, generate all bindings referenced by the service, generated
all portTypes referenced by the referenced bindings, etc. What if we're
generating code from a WSDL file that only contains portTypes, messages, and
types? If WSDL2Java used service as an anchor, and there's no service
in the file, then nothing will be generated. So the anchor is the lowest
element that exists in the WSDL file in the order:
For example, if a WSDL file only contained types, then all the listed types would be generated. But if a WSDL file contained types and a portType, then that portType will be generated and only those types that are referenced by that portType.
Note that the anchor is searched for in the WSDL file appearing on the command line, not in imported WSDL files. This allows one WSDL file to import constructs defined in another WSDL file without the nuisance of having all the imported WSDL file's constructs generated.
http://user:password@hostname:port/path/to/service?WSDL
Here is the help message generated from the current tool:
Java2WSDL emitter
Usage: java org.apache.axis.wsdl.Java2WSDL [options]
class-of-portType
Options:
-h, --help
print this message and exit
-I, --input
<argument>
input WSDL filename
-o, --output
<argument>
output WSDL filename
-l, --location
<argument>
service location url
-P, --portTypeName
<argument>
portType name (obtained from class-of-portType if not specified)
-b, --bindingName
<argument>
binding name ((--servicePortName value + "SOAPBinding" if not specified)
-S, --serviceElementName
<argument>
service element name (defaults to servicePortName value + "Service")
-s, --servicePortName
<argument>
service port name (obtained from --location if not specified)
-n, --namespace
<argument>
target namespace
-p, --PkgtoNS
<argument>=<value>
package=namespace, name value pairs
-m, --methods
<argument>
space or comma separated list of methods to export
-a, --all
look for allowed methods in inherited class
-w, --outputWsdlMode
<argument>
output WSDL mode: All, Interface, Implementation
-L, --locationImport
<argument>
location of interface WSDL
-N, --namespaceImpl
<argument>
target namespace for implementation WSDL
-O, --outputImpl
<argument>
output Implementation WSDL filename, setting this causes
--outputWsdlMode to be ignored
-i, --implClass
<argument>
optional class that contains implementation of methods in
class-of-portType. The debug information in the class is used
to obtain the method parameter names, which are used to set
the WSDL part names.
-x, --exclude
<argument>
space or comma separated list of methods not to export
-y, --style
<argument>
the style of the wsdl document: RPC, DOCUMENT or WRAPPED
-c, --stopClasses
<argument>
space or comma separated list of class names which stop inheritance search
if --all switch is enabled
-T, --typeMappingVersion
<argument>
indicate 1.1 or 1.2. The default is 1.2 (SOAP 1.2 JAX-RPC compliant)
-A, --soapAction
<argument>
value of the operations soapAction field. Values are DEFAULT,
OPERATION or NONE. OPERATION forces soapAction to the name
of the operation. DEFAULT causes the soapAction to be set
according to the operations meta data (usually ""). NONE
forces the soapAction to "". The default is DEFAULT.
-y, --style
<argument>
the style of the wsdl document: RPC, DOCUMENT or WRAPPED
Details:
portType element name= <.portTypeName
value> OR <class-of-portType name>
binding element name= <--bindingName value> OR
<--servicePortName value>SoapBinding
service element name= <--serviceElementName
value> OR <portTypeName value>Service
port element name=
<--servicePortName value>
address location =
<--location value>
-h , --help
Prints the help message.
-I, --input <WSDL file>
Optional parameter that indicates the name of the input wsdl file. The output
wsdl file will contain everything from the input wsdl file plus the new constructs.
If a new construct is already present in the input wsdl file, it is not added.
This option is useful for constructing a wsdl file with multiple ports, bindings,
or portTypes.
-o, --output <WSDL file>
Indicates the name of the output WSDL file. If not specified, a suitable
default WSDL file is written into the current directory.
-l, --location <location>
Indicates the url of the location of the service. The name after the last
slash or backslash is the name of the service port (unless overridden by the
-s option). The service port address location attribute is assigned the
specified value.
-P, --portTypeName <name>
Indicates the name to use use for the portType element. If not specified, the
class-of-portType name is used.
-b, --bindingName <name>
Indicates the name to use use for the binding element. If not specified, the
value of the --servicePortName + "SoapBinding" is used.
-S, --serviceElementName <name>
Indicates the name of the service element. If not specified, the service
element is the <portTypeName>Service.
-s, --servicePortName <name>
Indicates the name of the service port. If not specified, the service
port name is derived from the --location value.
-n, --namespace <target namespace>
Indicates the name of the target namespace of the WSDL.
-p, --PkgToNS <package> <namespace>
Indicates the mapping of a package to a namespace. If a package is encountered
that does not have a namespace, the Java2WSDL emitter will generate a suitable
namespace name. This option may be specified multiple times.
-m, --methods <arguments>
If this option is specified, only the indicated methods in your interface class
will be exported into the WSDL file. The methods list must be comma separated.
If not specified, all methods declared in the interface class will be exported
into the WSDL file.
-a, --all
If this option is specified, the Java2WSDL parser will look into extended classes
to determine the list of methods to export into the WSDL file.
-w, --outputWSDLMode <mode>
Indicates the kind of WSDL to generate. Accepted values are:
-N, --namespaceImpl <namespace>
Namespace of the implementation WSDL.
-O, --outputImpl <WSDL file>
Use this option to indicate the name of the output implementation WSDL file.
If specified, Java2WSDL will produce interface and implementation WSDL files.
If this option is used, the -w option is ignored.
-i, --implClass <impl-class>
Sometimes extra information is available in the implementation class file. Use
this option to specify the implementation class.
-x, --exclude <list>
List of methods to not exclude from the wsdl file.
-y, --style <argument>
The style of the WSDL document: RPC, DOCUMENT or WRAPPED.
If RPC, a rpc/encoded wsdl is generated.
If DOCUMENT, a document/literal wsdl is generated.
If WRAPPED, a document/literal wsdl is generated using the wrapped approach.
-c, --stopClasses <list>
List of classes which stop the Java2WSDL inheritance search.
-T, --typeMappingVersion <version>
Choose the default type mapping registry to use. Either 1.1 or 1.2.
-A, --soapAction <argument>
The value of the operations soapAction field. Values are DEFAULT, OPERATION or NONE. OPERATION forces soapAction to the name of the operation. DEFAULT causes the soapAction to be set according to the operation's meta data (usually ""). NONE forces the soapAction to "". The default is DEFAULT.
-y, --style <argument>
The style of the WSDL document: RPC, DOCUMENT or WRAPPED.
If RPC, a rpc/encoded wsdl is generated.
If DOCUMENT, a document/literal wsdl is generated.
If WRAPPED, a document/literal wsdl is generated using the wrapped approach.
<parameter name="name"
value="value"/>
, and common ones include:Java RPC Provider (provider="java:RPC") by default all public methods specified by the class
in the className option, including any inherited methods are
available as web services.
For more details regarding the Java Provider
please see WHERE???.
Java MsgProvder (provider="java:MSG")
In order to further restrict the above methods, the allowedMethods option may be used to specify in a space delimited list the names of only those methods which are allowed as web services. It is also possible to specify for this option the value "*" which is functionally equivalent to not specify the option at all. Also, it is worth mentioning that the operation element is used to further define the methods being offered, but it does not affect which methods are made available.
Note, while this is true for Axis supplied providers, it is implementation dependent on each individual provider. Please review your providers documentation on how or if it supports this option.
Note, Exposing any web service has security implications.
As a best practices guide it is
highly recommend when offering a web service in un secure environment to restrict allowed methods to only those
required for the service being offered. And, for those that are made available, to fully understand their function
and how they may access and expose your systems's resources.
<service name="test"> <parameter name="className" value="test.Implementation"/> <parameter name="allowedMethods" value="*"/> <namespace>http://testservice/</namespace> <requestFlow> <!-- Run these before processing the request --> <handler type="java:MyHandlerClass"/> <handler type="somethingIDefinedPreviously"/> </requestFlow> </service>Metadata may be specified about particular operations in your service by using the <operation> tag inside a service. This enables you to map the java parameter names of a method to particular XML names, to specify the parameter modes for your parameters, and to map particular XML names to particular operations.
<chain name="myChain"> <handler type="java:org.apache.axis.handlers.LogHandler"/> </chain>or may refer to previously defined <handlers>, with the "type" of the handler referring to the name of the other handler definition:
<handler name="logger" type="java:org.apache.axis.handlers.LogHandler"/>
<chain name="myChain"/>
<handler type="logger"/>
</chain>
% java org.apache.axis.client.AdminClient -llocal:// list