1.1 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
-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.
-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. The default is RPC.
If RPC is specified, an rpc wsdl is generated.
If DOCUMENT is specified, a document wsdl is generated.
If WRAPPED is specified, a document/literal wsdl is generated using the wrapped approach.
Wrapped style forces the use attribute to be literal.
-u, --use <argument>
The use of the WSDL document: LITERAL or ENCODED. If LITERAL is specified, the
XML Schema defines the representation of the XML for the request. If ENCODED
is specified, SOAP encoding is specified in the generated WSDL.
-e, --extraClasses <argument>
Specify a space or comma seperated list of class names which should be included in the types
section of the WSDL document. This is useful in the case where your service interface references
a base class and you would like your WSDL to contain XML Schema type defintions for these other
classes. The -extraClasses option can be specified duplicate times.
Each specification results in the additional classes being added to the list.
<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>
In the server-config file, there is a global configuration section, which supports parameter name/value pairs as nested elements. Here are the options that we currently document, though there may be more (consult the source, as usual).
<globalConfiguration> <parameter name="adminPassword" value="admin"/> <parameter name="attachments.Directory" value="c:\temp\attachments"/> <parameter name="sendMultiRefs" value="true"/> <parameter name="sendXsiTypes" value="true"/> <parameter name="attachments.implementation" value="org.apache.axis.attachments.AttachmentsImpl"/> <parameter name="sendXMLDeclaration" value="true"/> <parameter name="enable2DArrayEncoding" value="true"/> </globalConfiguration>
adminPassword | Adminstrator password, as used by AdminService. |
attachments.Directory | The directory where attachments end up. This should be in the syntax appropriate for the target platform. |
attachments.implementation | Name of class that implements attachments support. Default is org.apache.axis.attachments.AttachmentsImpl |
axis.enableListQuery | Flag to enable the "list the WSDD" feature. Set to false by default, because listing the current system config can expose information (such as the adminservice password) that one does not want widely avaialable. |
axis.Compiler | Compiler adapter classname for JWS compilation. Default is org.apache.axis.components.compiler.Javac; change this to org.apache.axis.components.compiler.Jikes to invoke jikes instead. |
axis.development.system | Flag to switch the system from production (false) to development (true). A development system gives out stack traces and other information that production boxes should not. |
axis.engineConfigClass | Name of a class that provides Axis configuration. Implement a new class implementing EngineConfiguration and name it here to use alternate configuration mechanisms. |
axis.jws.servletClassDir | Path to where compiled JWS pages are placed. |
axis.sendMinimizedElements | Flag to turn on support for a when .NET1.0 can't correctly handle some bits of XML that it should. The flag defaults to true; if some .NET clients are failing to handle a Web Service returning an empty array inside another object, set this flag to false. |
enable2DArrayEncoding | Set this to "true" to turn 2D array encoding on; this encoding is incompatible with .NET 1.0: default="false". |
sendMultiRefs | true/false flag to control whether multirefs are sent or not. |
sendXMLDeclaration | true/false flag to control whether the <?xml?> declaration is sent in messages |
sendXsiTypes | true/false flag to enable/disable sending the type of every value sent over the wire. Defaults to true. |
SingleSOAPVersion | When set to either "1.1" or "1.2", this configures the engine to only accept the specified SOAP version. Attempts to connect to the engine using another version will result in a fault. |
use-servlet-security | Set this flag to hand authentication off to the servlet container. |
Here are some of the per-service configuration options are available; these can be set in the wsdd file used to deploy a service, from where they will be picked up.
More may exist.
style | whether to use RPC:enc or doc/lit encoding |
SingleSOAPVersion | When set to either "1.1" or "1.2", this configures a service to only accept the specified SOAP version. Attempts to connect to the service using another version will result in a fault. |
wsdlFile | The path to a WSDL File; can be an absolute path or a resource that axis.jar can load. Useful to export your custom WSDL file. When specify a path to a resource, place a forward slash to start at the beginning of the classpath (e.g "/org/someone/res/mywsdl.wsdl"). How does Axis know whether to return a file or resource? It looks for a file first, if that is missing a resource is returned. |
Log4J can be configured using the file log4j.properties in the classpath; later versions also support an XML configuration. Axis includes a preconfigured log4j.properties file in axis.jar. While this is adequate for basic use, any complex project will want to modify their own version of the file. Here is what to do
org.apache.axis.TIME | A log that records the time to execute incoming messages, splitting up into preamble, invoke, post and send times. These are only logged at debug level. |
org.apache.axis.EXCEPTIONS | Exceptions that are sent back over the wire. AxisFaults, which are normally created in 'healthy' operation, are logged at debug level. Other Exceptions are logged at the Info level, as they are more indicative of server side trouble. |
org.apache.axis.enterprise | ''Enterprise'' level stuff, which generally means stuff that an enterprise product might want to track, but in a simple environment (like the AXIS build) would be nothing more than a nuisance. |
% java org.apache.axis.client.AdminClient -llocal:// list