org.apache.axis.wsdl
Class WSDL2Java

java.lang.Object
  |
  +--org.apache.axis.wsdl.WSDL2Java

public class WSDL2Java
extends java.lang.Object

Command line interface to the wsdl2java utility

Author:
Tom Jordahl (tjordahl@macromedia.com)

Field Summary
protected static int ALL_OPT
           
static byte APPLICATION_SCOPE
           
protected static int DEBUG_OPT
           
protected static int HELP_OPT
           
protected static int NAMESPACE_FILE_OPT
           
protected static int NAMESPACE_OPT
           
static byte NO_EXPLICIT_SCOPE
           
protected static int NOIMPORTS_OPT
           
protected static org.apache.avalon.excalibur.cli.CLOptionDescriptor[] options
          Define the understood options.
protected static int OUTPUT_OPT
           
protected static int PACKAGE_OPT
           
static byte REQUEST_SCOPE
           
protected static int SCOPE_OPT
           
protected static int SERVER_OPT
           
static byte SESSION_SCOPE
           
protected static int SKELETON_DEPLOY_OPT
           
protected static int TEST_OPT
           
protected static int TYPEMAPPING_OPT
           
protected static int VERBOSE_OPT
           
 
Constructor Summary
WSDL2Java()
          Instantiate a WSDL2Java emitter.
 
Method Summary
 void debug(boolean value)
          Turn on/off debug messages.
 void deploySkeleton(boolean value)
          Turn on/off server skeleton deploy
 void emit(java.lang.String wsdlURL)
          Emit appropriate Java files for a WSDL at a given URL.
 void emit(java.lang.String context, org.w3c.dom.Document doc)
          Call this method if your WSDL document has already been parsed as an XML DOM document.
 void generateAll(boolean all)
          By default, code is generated only for referenced elements.
 void generateImports(boolean generateImports)
          Turn on/off generation of elements from imported files.
 void generateServerSide(boolean value)
          Turn on/off server skeleton creation
 void generateTestCase(boolean value)
          Turn on/off test case creation
 javax.wsdl.Definition getCurrentDefinition()
          Return the current definition
 boolean getDebug()
          Return the status of the debug switch.
 boolean getDeploySkeleton()
          Indicate if we should be deploying skeleton or implementation
 java.util.List getGeneratedClassNames()
          Return a list of all generated class names.
 GeneratedFileInfo getGeneratedFileInfo()
          Returns an object which contains of information on all generated files including the class name, filename and a type string.
 java.util.List getGeneratedFileNames()
          Return a list of all generated file names.
 boolean getGenerateServerSide()
          Indicate if we should be emitting server side code and deploy/undeploy
 java.lang.String getOutputDir()
          Get the output directory to use for emitted source files
 java.lang.String getPackageName()
          Get global package name to use instead of mapping namespaces
 byte getScope()
          Get the scope for the deploy.xml file.
 long getTimeout()
          Return the current timeout setting
 boolean getVerbose()
          Return the status of the verbose switch
static void main(java.lang.String[] args)
          Main
 void setNamespaceMap(java.util.HashMap map)
          Set a map of namespace -> Java package names
 void setNStoPkg(java.io.File NStoPkgFile)
          Set the NStoPkg mappings file.
 void setNStoPkg(java.lang.String NStoPkgFilename)
          Set the NStoPkg mappings filename.
 void setOutputDir(java.lang.String outputDir)
          Set the output directory to use in emitted source files
 void setPackageName(java.lang.String packageName)
          Set a global package name to use instead of mapping namespaces
 void setScope(byte scope)
          Set the scope for the deploy.xml file.
 void setTimeout(long timeout)
          Set the timeout, in milliseconds
 void setTypeMappingVersion(java.lang.String typeMappingVersion)
           
 void verbose(boolean value)
          Turn on/off verbose messages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HELP_OPT

protected static final int HELP_OPT

VERBOSE_OPT

protected static final int VERBOSE_OPT

SERVER_OPT

protected static final int SERVER_OPT

SKELETON_DEPLOY_OPT

protected static final int SKELETON_DEPLOY_OPT

NAMESPACE_OPT

protected static final int NAMESPACE_OPT

NAMESPACE_FILE_OPT

protected static final int NAMESPACE_FILE_OPT

OUTPUT_OPT

protected static final int OUTPUT_OPT

SCOPE_OPT

protected static final int SCOPE_OPT

TEST_OPT

protected static final int TEST_OPT

NOIMPORTS_OPT

protected static final int NOIMPORTS_OPT

PACKAGE_OPT

protected static final int PACKAGE_OPT

DEBUG_OPT

protected static final int DEBUG_OPT

ALL_OPT

protected static final int ALL_OPT

TYPEMAPPING_OPT

protected static final int TYPEMAPPING_OPT

NO_EXPLICIT_SCOPE

public static final byte NO_EXPLICIT_SCOPE

APPLICATION_SCOPE

public static final byte APPLICATION_SCOPE

REQUEST_SCOPE

public static final byte REQUEST_SCOPE

SESSION_SCOPE

public static final byte SESSION_SCOPE

options

protected static final org.apache.avalon.excalibur.cli.CLOptionDescriptor[] options
Define the understood options. Each CLOptionDescriptor contains: - The "long" version of the option. Eg, "help" means that "--help" will be recognised. - The option flags, governing the option's argument(s). - The "short" version of the option. Eg, 'h' means that "-h" will be recognised. - A description of the option for the usage message
Constructor Detail

WSDL2Java

public WSDL2Java()
Instantiate a WSDL2Java emitter.
Method Detail

generateServerSide

public void generateServerSide(boolean value)
Turn on/off server skeleton creation
Parameters:
boolean - value

getGenerateServerSide

public boolean getGenerateServerSide()
Indicate if we should be emitting server side code and deploy/undeploy

deploySkeleton

public void deploySkeleton(boolean value)
Turn on/off server skeleton deploy
Parameters:
boolean - value

getDeploySkeleton

public boolean getDeploySkeleton()
Indicate if we should be deploying skeleton or implementation

generateTestCase

public void generateTestCase(boolean value)
Turn on/off test case creation
Parameters:
boolean - value

getCurrentDefinition

public javax.wsdl.Definition getCurrentDefinition()
Return the current definition

generateImports

public void generateImports(boolean generateImports)
Turn on/off generation of elements from imported files.
Parameters:
boolean - generateImports

generateAll

public void generateAll(boolean all)
By default, code is generated only for referenced elements. Call generateAll(true) and WSDL2Java will generate code for all elements in the scope regardless of whether they are referenced. Scope means: by default, all WSDL files; if generateImports(false), then only the immediate WSDL file.

debug

public void debug(boolean value)
Turn on/off debug messages.
Parameters:
boolean - value

getDebug

public boolean getDebug()
Return the status of the debug switch.

verbose

public void verbose(boolean value)
Turn on/off verbose messages
Parameters:
boolean - value

getVerbose

public boolean getVerbose()
Return the status of the verbose switch

setNamespaceMap

public void setNamespaceMap(java.util.HashMap map)
Set a map of namespace -> Java package names

setOutputDir

public void setOutputDir(java.lang.String outputDir)
Set the output directory to use in emitted source files

getPackageName

public java.lang.String getPackageName()
Get global package name to use instead of mapping namespaces

setPackageName

public void setPackageName(java.lang.String packageName)
Set a global package name to use instead of mapping namespaces

getOutputDir

public java.lang.String getOutputDir()
Get the output directory to use for emitted source files

setScope

public void setScope(byte scope)
Set the scope for the deploy.xml file.
Parameters:
scope - One of Emitter.NO_EXPLICIT_SCOPE, Emitter.APPLICATION_SCOPE, Emitter.REQUEST_SCOPE, Emitter.SESSION_SCOPE. Anything else is equivalent to NO_EXPLICIT_SCOPE and no explicit scope tag will appear in deploy.xml.

getScope

public byte getScope()
Get the scope for the deploy.xml file.

setNStoPkg

public void setNStoPkg(java.lang.String NStoPkgFilename)
Set the NStoPkg mappings filename.

setNStoPkg

public void setNStoPkg(java.io.File NStoPkgFile)
Set the NStoPkg mappings file.

getTimeout

public long getTimeout()
Return the current timeout setting

setTimeout

public void setTimeout(long timeout)
Set the timeout, in milliseconds

getGeneratedFileInfo

public GeneratedFileInfo getGeneratedFileInfo()
Returns an object which contains of information on all generated files including the class name, filename and a type string.
Returns:
A org.apache.axis.wsdl.toJava.GeneratedFileInfo object
See Also:
GeneratedFileInfo

getGeneratedClassNames

public java.util.List getGeneratedClassNames()
Return a list of all generated class names.
Returns:
list of class names (strings)

getGeneratedFileNames

public java.util.List getGeneratedFileNames()
Return a list of all generated file names.
Returns:
list of relative path names (strings)

emit

public void emit(java.lang.String wsdlURL)
          throws java.lang.Exception
Emit appropriate Java files for a WSDL at a given URL. This method will time out after the number of milliseconds specified by our timeoutms member.
Parameters:
String - wsdlURI the location of the WSDL file.

emit

public void emit(java.lang.String context,
                 org.w3c.dom.Document doc)
          throws java.io.IOException,
                 javax.wsdl.WSDLException
Call this method if your WSDL document has already been parsed as an XML DOM document.
Parameters:
String - context This is directory context for the Document. If the Document were from file "/x/y/z.wsdl" then the context could be "/x/y" (even "/x/y/z.wsdl" would work). If context is null, then the context becomes the current directory.
Document - doc This is the XML Document containing the WSDL.

main

public static void main(java.lang.String[] args)
Main

setTypeMappingVersion

public void setTypeMappingVersion(java.lang.String typeMappingVersion)


Copyright © 2001 Apache XML Project. All Rights Reserved.