|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This WSDL2Java is an interface for the WSDL2Java generator tool.
This tool processes WSDL files and generates Java classes along the definitions.
To specify the source WSDL definition you can use either
setDefinition(javax.wsdl.Definition)
or setEndpoint(org.idoox.transport.client.Endpoint)
method.
To read the WSDL definition you can use class
WSDLReader
which can be obtained using
WSDLFactory.newWSDLReader()
.
Using the method #setOutputBackends) it is possible to
specify the output backend. There are different output backends
for e.g. Java interfaces, Java interfaces for asynchronous calls,
Java default implementation etc. The list of output backends can be
found in the deployment descriptor (package.xml
) of the
core_tools package, which is one of the WSO2 SOA Enablement Server packages.
Using the method {@link #setCompilerIO} it is possible to specify where should be the generated classes written. You can either provide your own implementation of the {@link CompilerIO} interface or use simple implementation {@link org.idoox.wasp.tools.common.FileCompilerIO}. Please note this method must be called before you try to call {@link #process} method.
Nested Class Summary | |
static class |
WSDL2Java.JavaVersion
Represents version of Java. |
Field Summary | |
static int |
MODE_FROM_BINDING
|
static int |
MODE_FROM_PORTTYPE
|
static int |
MODE_FROM_SERVICE
|
static int |
MODE_TYPES_AS_INTERFACES
|
static int |
MODE_TYPES_AS_JAVABEANS
|
static int |
MODE_TYPES_AS_STRUCTURES
|
static int |
PROTOCOL_HTTPGET
Constant representing HTTP GET binding |
static int |
PROTOCOL_SOAP11
Constant representing SOAP 1.1 XML protocol. |
static int |
PROTOCOL_SOAP12
Constant representing SOAP 1.2 XML protocol. |
Method Summary | |
java.lang.String[] |
getAvailableBackends()
Returns available WSDL2Java's backends. |
CompilerIO |
getCompilerIO()
Returns the compilerIO. |
Processing |
getDDProcessing()
returns the Processing |
Definition |
getDefinition()
Returns the WSDL definition. |
Endpoint |
getEndpoint()
Returns the definition's endpoint |
boolean |
getGeneratingLiteralAsDOM()
returns true if mapping literal into DOM element, false otherwise |
java.lang.String |
getIfacesPackage()
returns the package into which interfaces are generated |
int |
getMode()
returns the processing mode |
java.util.Map |
getNamespace2PackageMapping()
Returns a local mapping from XML schema namespace to Java package name. |
int |
getProtocol()
Returns preferred protocol. |
java.util.Map |
getSchema2JavaExceptionMapping()
Retuns the current schema qname -> java exception class name mapping. |
java.util.Map |
getSchema2JavaMapping()
Returns a local mapping from XML Schema types to Java classes. |
WSDL2Java.JavaVersion |
getTargetJava()
|
int |
getTypesGeneratingMode()
returns generating mode for types |
java.lang.String |
getTypesPackage()
returns the package into which types are generated |
int |
getVerbosityLevel()
Returns the verbosity level. |
boolean |
isBeautifyingOutputStructures()
Returns true if beautification of output structures is activated. |
boolean |
isGeneratingAllTypes()
Deprecated. always returns true |
boolean |
isMapMixedToDom()
|
boolean |
isNothingGenerated()
Returns true if nothing was generated (in this case, when WSDL2Java finishes, warning is output to the user. |
boolean |
isUnwrap()
Returns value of the "unwrap" property. |
void |
process()
Processes the definition and writes the output using the compilerIO, which must be previously set. |
void |
setBeautifyingOutputStructures(boolean beautifyingOutputStructures)
Sets if beautifying output structures is activated. |
void |
setCompilerIO(CompilerIO compilerIO)
Sets the compilerIO. |
void |
setDDProcessing(Processing processing)
Sets the Processing. |
void |
setDefinition(Definition wsdl)
Sets the definition document to be processed. |
void |
setEndpoint(Endpoint endpoint)
Sets the definition's endpoint. |
void |
setGeneratedPort(java.lang.String port)
Generate only this port from the definition. |
void |
setGeneratedPortType(QName portType)
Generate only this port type from the definition. |
void |
setGeneratedService(QName serviceQName)
Generate only this service from the definition. |
void |
setGeneratingAllTypes(boolean generatingAllTypes)
Deprecated. always set to true |
void |
setGeneratingLiteralAsDOM(boolean generateLiteralAsDOM)
Set to true if mapping literal into DOM element, false otherwise |
void |
setIfacesPackage(java.lang.String packageName)
Sets the name of the Java package into which the interfaces are generated. |
void |
setMapMixedToDom(boolean value)
Sets the property setting handling of mixed content. |
void |
setMode(int mode)
sets the processing mode |
void |
setNamespace2PackageMapping(java.util.Map namespace2PackageMapping)
Sets a local mapping from XML schema namespace to Java package name. |
void |
setNothingGenerated(boolean nothingGenerated)
sets the nothing generated flag. |
void |
setOutputBackends(java.lang.String outputBackends)
Sets the output backends mentioned in the configuration, for example java , java-async ,
java-impl . |
void |
setProtocol(int protocol)
Sets preferred protocol. |
void |
setSchema2JavaExceptionMapping(java.util.Map schema2JavaMapping)
Sets the schema qname -> java exception class name mapping. |
void |
setSchema2JavaMapping(java.util.Map schema2JavaMapping)
Sets a local mapping from XML Schem types to Java classes. |
void |
setTargetJava(WSDL2Java.JavaVersion version)
Sets the target java version of generated source. |
void |
setTypesGeneratingMode(int mode)
Sets generating mode for types. |
void |
setTypesPackage(java.lang.String packageName)
Sets the name of the Java package into which the types from WSDL are generated. |
void |
setUnwrap(boolean shouldUnwrap)
Set whether the WSDL2Java should unwrap the wrapping elements around parameters in operations with "wrapped" document/literal style. |
void |
setVerbosityLevel(int verbosityLevel)
Sets if verbose output is printed. |
Field Detail |
public static final int PROTOCOL_SOAP11
public static final int PROTOCOL_SOAP12
public static final int PROTOCOL_HTTPGET
public static final int MODE_FROM_SERVICE
public static final int MODE_FROM_BINDING
public static final int MODE_FROM_PORTTYPE
public static final int MODE_TYPES_AS_STRUCTURES
public static final int MODE_TYPES_AS_INTERFACES
public static final int MODE_TYPES_AS_JAVABEANS
Method Detail |
public void setDefinition(Definition wsdl)
Definition
can be obtained using the
WSDLReader
. setEndpoint(org.idoox.transport.client.Endpoint)
.
wsdl
- the definition document to be processed after call the
process()
methodpublic Definition getDefinition()
public void setEndpoint(Endpoint endpoint)
setDefinition(javax.wsdl.Definition)
) when calling
process()
method,
it will be loaded from the specified endpoint.
endpoint
- the definition's endpointpublic Endpoint getEndpoint()
public void setCompilerIO(CompilerIO compilerIO)
CompilerIO
or use e.g.
the FileCompilerIO
.
This method must be called before the process()
method is called.
compilerIO
- implementation of CompilerIO
interfacepublic CompilerIO getCompilerIO()
public void setOutputBackends(java.lang.String outputBackends)
java
, java-async
,
java-impl
.
outputBackends
- name of backends setpublic java.lang.String[] getAvailableBackends()
public void setVerbosityLevel(int verbosityLevel)
verbosityLevel
- the verbosity level (0-10), 0 .. no outputpublic int getVerbosityLevel()
public void setMode(int mode)
mode
- the processing modepublic int getMode()
public void setDDProcessing(Processing processing)
processing
- the processingpublic Processing getDDProcessing()
public void setGeneratingAllTypes(boolean generatingAllTypes)
public boolean isGeneratingAllTypes()
public void setIfacesPackage(java.lang.String packageName)
packageName
- package into which interfaces are generated,
must be a valid Java package namepublic java.lang.String getIfacesPackage()
public void setTypesPackage(java.lang.String packageName)
setSchema2JavaMapping(java.util.Map)
.
packageName
- package into which types are generated, must ba valid
Java package namepublic java.lang.String getTypesPackage()
public void setTypesGeneratingMode(int mode)
MODE_TYPES_AS_STRUCTURES
(default one),
MODE_TYPES_AS_JAVABEANS
,
MODE_TYPES_AS_INTERFACES
mode
- generating mode for typespublic int getTypesGeneratingMode()
MODE_TYPES_AS_STRUCTURES
(default one),
MODE_TYPES_AS_JAVABEANS
,
MODE_TYPES_AS_INTERFACES
public void setGeneratingLiteralAsDOM(boolean generateLiteralAsDOM)
generateLiteralAsDOM
- true if mapping literal into DOM
element, false otherwisepublic boolean getGeneratingLiteralAsDOM()
public void setGeneratedService(QName serviceQName)
serviceQName
- service to be generatedpublic void setGeneratedPort(java.lang.String port)
port
- port to be generatedpublic void setGeneratedPortType(QName portType)
portType
- port type to be generatedpublic boolean isBeautifyingOutputStructures()
public void setBeautifyingOutputStructures(boolean beautifyingOutputStructures)
beautifyingOutputStructures
- if true a beautification mode is activated,
if false otherwise.public java.util.Map getSchema2JavaMapping()
public void setSchema2JavaMapping(java.util.Map schema2JavaMapping)
setSchema2JavaMapping(java.util.Map)
and setTypesPackage(java.lang.String)
.
.
schema2JavaMapping
- mapping between the schema types and the
Java classes. The key of this map is allways QName
of the
XSD type, the value is the String
name of the
Java classpublic java.util.Map getSchema2JavaExceptionMapping()
null
public void setSchema2JavaExceptionMapping(java.util.Map schema2JavaMapping)
schema2JavaMapping
- the new mappingpublic void setNamespace2PackageMapping(java.util.Map namespace2PackageMapping)
setTypesPackage(java.lang.String)
.
Type of the key is String, type of the value is String
namespace2PackageMapping
- public java.util.Map getNamespace2PackageMapping()
setTypesPackage(java.lang.String)
.
public void process() throws WSDL2JavaException
process
method
set use the setCompilerIO(org.idoox.wasp.tools.CompilerIO)
to specify
where the output should be written and also set
the definition to be processed - you can do this
with either setDefinition(javax.wsdl.Definition)
or
setEndpoint(org.idoox.transport.client.Endpoint)
method.
setDefinition(javax.wsdl.Definition)
method uses the
Definition
form of the WSDL - see
the WSDLReader
how to obtain it.
setEndpoint(org.idoox.transport.client.Endpoint)
method, you have to
consruct the Endpoint
e.g. from a String representation of the WSDL URL.
WSDL2JavaException
public boolean isNothingGenerated()
public void setNothingGenerated(boolean nothingGenerated)
nothingGenerated
- true if nothing has been generated at all.public void setProtocol(int protocol)
PROTOCOL_SOAP11
and PROTOCOL_SOAP12
constants.
protocol
- preferred protocol, one of PROTOCOL_SOAP11
,
PROTOCOL_SOAP12
public int getProtocol()
PROTOCOL_SOAP11
constants.
public void setUnwrap(boolean shouldUnwrap)
complexType
, either
sequence
or all
"Response"
for the output
message.
This type of WSDLs is required by the WS-I basic profile.
When setting the "unwrap" property false
, WSDL2Java will
generate Java structures corresponding to these wrapper elements with
the fields inside.
shouldUnwrap
- unwrap orpublic boolean isUnwrap()
setUnwrap(boolean)
public void setMapMixedToDom(boolean value)
true
means that mixed complex type is mapped to an DOM element,
false
means that the character data are ignored and only subelements
are considered.
value
- a new value of the propertypublic boolean isMapMixedToDom()
setMapMixedToDom(boolean)
public void setTargetJava(WSDL2Java.JavaVersion version)
version
- a new version; not null
'public WSDL2Java.JavaVersion getTargetJava()
setTargetJava(org.idoox.wasp.tools.wsdl2java.WSDL2Java.JavaVersion)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |