org.jboss.wsf.spi.tools
Class WSContractConsumer

java.lang.Object
  extended by org.jboss.wsf.spi.tools.WSContractConsumer

public abstract class WSContractConsumer
extends java.lang.Object

WSContractConsumer is responsible for generating JAX-WS client and server artifacts from the specified WSDL file. To implement a client, one would use the generated ___Service.java file. For a server, one only needs to provide an implementation class that implements the generated service endpoint interface.

Author:
Jason T. Greene

Field Summary
static java.lang.String PROVIDER_PROPERTY
           
 
Constructor Summary
WSContractConsumer()
           
 
Method Summary
 void consume(java.lang.String wsdl)
          Generate the required artifacts using the specified WSDL.
abstract  void consume(java.net.URL wsdl)
          Generate the required artifacts using the specified WSDL URL.
static WSContractConsumer newInstance()
          Obtain a new instance of a WSContractConsumer.
static WSContractConsumer newInstance(java.lang.ClassLoader loader)
          Obtain a new instance of a WSContractConsumer.
abstract  void setAdditionalCompilerClassPath(java.util.List<java.lang.String> classPath)
          Sets the additional classpath to use if/when invoking the Java compiler.
abstract  void setBindingFiles(java.util.List<java.io.File> bindingFiles)
          Specifies the JAX-WS and JAXB binding files to use on import operations.
abstract  void setCatalog(java.io.File catalog)
          Sets the OASIS XML Catalog file to use for entity resolution.
abstract  void setExtension(boolean extension)
          Enables/Disables SOAP 1.2 binding extension
abstract  void setGenerateSource(boolean generateSource)
          Enables/Disables Java source generation.
abstract  void setMessageStream(java.io.PrintStream messageStream)
          Sets the PrintStream to use for status feedback.
abstract  void setNoCompile(boolean nocompile)
          Enables/Disables Java source compilation.
abstract  void setOutputDirectory(java.io.File directory)
          Sets the main output directory.
abstract  void setSourceDirectory(java.io.File directory)
          Sets the source directory.
abstract  void setTarget(java.lang.String target)
          Set the target JAX-WS specification target.
abstract  void setTargetPackage(java.lang.String targetPackage)
          Sets the target package for generated source.
abstract  void setWsdlLocation(java.lang.String wsdlLocation)
          Sets the @@WebService.wsdlLocation and @@WebServiceClient.wsdlLocation attributes to a custom value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROVIDER_PROPERTY

public static final java.lang.String PROVIDER_PROPERTY
See Also:
Constant Field Values
Constructor Detail

WSContractConsumer

public WSContractConsumer()
Method Detail

newInstance

public static WSContractConsumer newInstance()
Obtain a new instance of a WSContractConsumer. This will use the current thread's context class loader to locate the WSContractConsumerFactory implementation.

Returns:
a new WSContractConsumer

newInstance

public static WSContractConsumer newInstance(java.lang.ClassLoader loader)
Obtain a new instance of a WSContractConsumer. The specified ClassLoader will be used to locate the WebServiceImporterProvide implementation

Parameters:
loader - the ClassLoader to use
Returns:
a new WSContractConsumer

setBindingFiles

public abstract void setBindingFiles(java.util.List<java.io.File> bindingFiles)
Specifies the JAX-WS and JAXB binding files to use on import operations.

Parameters:
bindingFiles - list of JAX-WS or JAXB binding files

setCatalog

public abstract void setCatalog(java.io.File catalog)
Sets the OASIS XML Catalog file to use for entity resolution.

Parameters:
catalog - the OASIS XML Catalog file

setOutputDirectory

public abstract void setOutputDirectory(java.io.File directory)
Sets the main output directory. If the directory does not exist, it will be created.

Parameters:
directory - the root directory for generated files

setSourceDirectory

public abstract void setSourceDirectory(java.io.File directory)
Sets the source directory. This directory will contain any generated Java source. If the directory does not exist, it will be created. If not specified, the output directory will be used instead.

Parameters:
directory - the root directory for generated source code

setExtension

public abstract void setExtension(boolean extension)
Enables/Disables SOAP 1.2 binding extension

Parameters:
extension - whether or not to enable SOAP 1.2 binding extension

setGenerateSource

public abstract void setGenerateSource(boolean generateSource)
Enables/Disables Java source generation.

Parameters:
generateSource - whether or not to generate Java source.

setNoCompile

public abstract void setNoCompile(boolean nocompile)
Enables/Disables Java source compilation.

Parameters:
nocompile - whether or not to compile Java source.

setTargetPackage

public abstract void setTargetPackage(java.lang.String targetPackage)
Sets the target package for generated source. If not specified the default is based off of the XML namespace.

Parameters:
targetPackage - the target package for generated source

setWsdlLocation

public abstract void setWsdlLocation(java.lang.String wsdlLocation)
Sets the @@WebService.wsdlLocation and @@WebServiceClient.wsdlLocation attributes to a custom value.

Parameters:
wsdlLocation - the custom WSDL location to use in generated source

setMessageStream

public abstract void setMessageStream(java.io.PrintStream messageStream)
Sets the PrintStream to use for status feedback. The simplest example would be to use System.out.

Parameters:
messageStream - the stream to use for status messages:

setAdditionalCompilerClassPath

public abstract void setAdditionalCompilerClassPath(java.util.List<java.lang.String> classPath)
Sets the additional classpath to use if/when invoking the Java compiler. Typically an implementation will use the system java.class.path property. So for most normal applications this method is not needed. However, if this API is being used from an isolated classloader, then it needs to be called in order to reference all jars that are required by the implementation.

Parameters:
classPath - a list of strings where each entry references a single jar or directory

setTarget

public abstract void setTarget(java.lang.String target)
Set the target JAX-WS specification target. Defaults to 2.0

Parameters:
target - the JAX-WS specification version. Allowed values are 2.0, 2.1

consume

public abstract void consume(java.net.URL wsdl)
Generate the required artifacts using the specified WSDL URL. This method may be called more than once, although this is probably not desireable

Parameters:
wsdl - the URL of the WSDL

consume

public void consume(java.lang.String wsdl)
             throws java.net.MalformedURLException
Generate the required artifacts using the specified WSDL. This method may be called more than once, although this is probably not desireable. The passed string is expect to either be a valid URL, or a local file path.

Parameters:
wsdl - a URL or local file path
Throws:
java.net.MalformedURLException - if wsdl is not a legal URL or local file


Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.