org.jboss.soa.esb.actions.soap
Class JBossWSDLReader

java.lang.Object
  extended by org.jboss.soa.esb.actions.soap.JBossWSDLReader
All Implemented Interfaces:
javax.wsdl.xml.WSDLReader

public class JBossWSDLReader
extends java.lang.Object
implements javax.wsdl.xml.WSDLReader

A WSDLReader fork of the original wsdl4j 1.6.2 package that delegates to the JBossWSEntityResolver in private static Document getDocument(InputSource inputSource,String desc)

Original authors: Matthew J. Duftler,Nirmal Mukhi

Author:
Magesh Kumar B

Field Summary
protected  java.util.Map allSchemas
           
protected  javax.wsdl.extensions.ExtensionRegistry extReg
           
protected  javax.wsdl.factory.WSDLFactory factory
           
protected  java.lang.String factoryImplName
           
protected  boolean importDocuments
           
protected  javax.wsdl.xml.WSDLLocator loc
           
 
Constructor Summary
JBossWSDLReader()
           
 
Method Summary
 javax.wsdl.extensions.ExtensionRegistry getExtensionRegistry()
          Get the extension registry, if one was set.
 java.lang.String getFactoryImplName()
          Get the factoryImplName, if one was set.
 boolean getFeature(java.lang.String name)
          Gets the value of the specified feature.
protected  javax.wsdl.factory.WSDLFactory getWSDLFactory()
          Get the WSDLFactory object cached in the reader, or use lazy instantiation if it is not cached yet.
protected  javax.wsdl.Binding parseBinding(org.w3c.dom.Element bindingEl, javax.wsdl.Definition def)
           
protected  javax.wsdl.BindingFault parseBindingFault(org.w3c.dom.Element bindingFaultEl, javax.wsdl.Definition def)
           
protected  javax.wsdl.BindingInput parseBindingInput(org.w3c.dom.Element bindingInputEl, javax.wsdl.Definition def)
           
protected  javax.wsdl.BindingOperation parseBindingOperation(org.w3c.dom.Element bindingOperationEl, javax.wsdl.PortType portType, javax.wsdl.Definition def)
           
protected  javax.wsdl.BindingOutput parseBindingOutput(org.w3c.dom.Element bindingOutputEl, javax.wsdl.Definition def)
           
protected  javax.wsdl.Definition parseDefinitions(java.lang.String documentBaseURI, org.w3c.dom.Element defEl, java.util.Map importedDefs)
           
protected  java.lang.Object parseExtensibilityAttribute(org.w3c.dom.Element el, int attrType, java.lang.String attrValue, javax.wsdl.Definition def)
           
protected  void parseExtensibilityAttributes(org.w3c.dom.Element el, java.lang.Class parentType, javax.wsdl.extensions.AttributeExtensible attrExt, javax.wsdl.Definition def)
           
protected  javax.wsdl.extensions.ExtensibilityElement parseExtensibilityElement(java.lang.Class parentType, org.w3c.dom.Element el, javax.wsdl.Definition def)
           
protected  javax.wsdl.Fault parseFault(org.w3c.dom.Element faultEl, javax.wsdl.Definition def)
           
protected  javax.wsdl.Import parseImport(org.w3c.dom.Element importEl, javax.wsdl.Definition def, java.util.Map importedDefs)
           
protected  javax.wsdl.Input parseInput(org.w3c.dom.Element inputEl, javax.wsdl.Definition def)
           
protected  javax.wsdl.Message parseMessage(org.w3c.dom.Element msgEl, javax.wsdl.Definition def)
           
protected  javax.wsdl.Operation parseOperation(org.w3c.dom.Element opEl, javax.wsdl.PortType portType, javax.wsdl.Definition def)
           
protected  javax.wsdl.Output parseOutput(org.w3c.dom.Element outputEl, javax.wsdl.Definition def)
           
protected  javax.wsdl.Part parsePart(org.w3c.dom.Element partEl, javax.wsdl.Definition def)
           
protected  javax.wsdl.Port parsePort(org.w3c.dom.Element portEl, javax.wsdl.Definition def)
           
protected  javax.wsdl.PortType parsePortType(org.w3c.dom.Element portTypeEl, javax.wsdl.Definition def)
           
protected  javax.wsdl.extensions.ExtensibilityElement parseSchema(java.lang.Class parentType, org.w3c.dom.Element el, javax.wsdl.Definition def)
           
protected  javax.wsdl.extensions.ExtensibilityElement parseSchema(java.lang.Class parentType, org.w3c.dom.Element el, javax.wsdl.Definition def, javax.wsdl.extensions.ExtensionRegistry extReg)
           
protected  javax.wsdl.Service parseService(org.w3c.dom.Element serviceEl, javax.wsdl.Definition def)
           
protected  javax.wsdl.Types parseTypes(org.w3c.dom.Element typesEl, javax.wsdl.Definition def)
           
 javax.wsdl.Definition readWSDL(java.lang.String wsdlURI)
          Read the WSDL document accessible via the specified URI into a WSDL definition.
 javax.wsdl.Definition readWSDL(java.lang.String documentBaseURI, org.w3c.dom.Document wsdlDocument)
          Read the specified WSDL document into a WSDL definition.
 javax.wsdl.Definition readWSDL(java.lang.String documentBaseURI, org.w3c.dom.Element definitionsElement)
          Read the specified <wsdl:definitions> element into a WSDL definition.
protected  javax.wsdl.Definition readWSDL(java.lang.String documentBaseURI, org.w3c.dom.Element definitionsElement, java.util.Map importedDefs)
           
 javax.wsdl.Definition readWSDL(java.lang.String documentBaseURI, org.xml.sax.InputSource inputSource)
          Read a WSDL document into a WSDL definition.
 javax.wsdl.Definition readWSDL(java.lang.String contextURI, java.lang.String wsdlURI)
          Read the WSDL document accessible via the specified URI into a WSDL definition.
 javax.wsdl.Definition readWSDL(javax.wsdl.xml.WSDLLocator locator)
          Read a WSDL document into a WSDL definition.
 javax.wsdl.Definition readWSDL(javax.wsdl.xml.WSDLLocator locator, org.w3c.dom.Element definitionsElement)
          Read the specified <wsdl:definitions> element into a WSDL definition.
 void setExtensionRegistry(javax.wsdl.extensions.ExtensionRegistry extReg)
          Set the extension registry to be used when reading WSDL documents into a WSDL definition.
 void setFactoryImplName(java.lang.String factoryImplName)
          Set a different factory implementation to use for creating definitions when reading WSDL documents.
 void setFeature(java.lang.String name, boolean value)
          Sets the specified feature to the specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

importDocuments

protected boolean importDocuments

extReg

protected javax.wsdl.extensions.ExtensionRegistry extReg

factoryImplName

protected java.lang.String factoryImplName

loc

protected javax.wsdl.xml.WSDLLocator loc

factory

protected javax.wsdl.factory.WSDLFactory factory

allSchemas

protected java.util.Map allSchemas
Constructor Detail

JBossWSDLReader

public JBossWSDLReader()
Method Detail

setFeature

public void setFeature(java.lang.String name,
                       boolean value)
                throws java.lang.IllegalArgumentException
Sets the specified feature to the specified value.

The supported features are:

Name Description Default Value
javax.wsdl.importDocuments
If set to true, imported WSDL documents will be retrieved and processed.
true

All feature names must be fully-qualified, Java package style. All names starting with javax.wsdl. are reserved for features defined by the JWSDL specification. It is recommended that implementation- specific features be fully-qualified to match the package name of that implementation. For example: com.abc.featureName

Specified by:
setFeature in interface javax.wsdl.xml.WSDLReader
Parameters:
name - the name of the feature to be set.
value - the value to set the feature to.
Throws:
java.lang.IllegalArgumentException - if the feature name is not recognized.
See Also:
getFeature(String)

getFeature

public boolean getFeature(java.lang.String name)
                   throws java.lang.IllegalArgumentException
Gets the value of the specified feature.

Specified by:
getFeature in interface javax.wsdl.xml.WSDLReader
Parameters:
name - the name of the feature to get the value of.
Returns:
the value of the feature.
Throws:
java.lang.IllegalArgumentException - if the feature name is not recognized.
See Also:
setFeature(String, boolean)

setExtensionRegistry

public void setExtensionRegistry(javax.wsdl.extensions.ExtensionRegistry extReg)
Set the extension registry to be used when reading WSDL documents into a WSDL definition. If an extension registry is set, that is the extension registry that will be set as the extensionRegistry property of the definitions resulting from invoking readWSDL(...). Default is null.

Specified by:
setExtensionRegistry in interface javax.wsdl.xml.WSDLReader
Parameters:
extReg - the extension registry to use for new definitions

getExtensionRegistry

public javax.wsdl.extensions.ExtensionRegistry getExtensionRegistry()
Get the extension registry, if one was set. Default is null.

Specified by:
getExtensionRegistry in interface javax.wsdl.xml.WSDLReader

getWSDLFactory

protected javax.wsdl.factory.WSDLFactory getWSDLFactory()
                                                 throws javax.wsdl.WSDLException
Get the WSDLFactory object cached in the reader, or use lazy instantiation if it is not cached yet.

Throws:
javax.wsdl.WSDLException

setFactoryImplName

public void setFactoryImplName(java.lang.String factoryImplName)
                        throws java.lang.UnsupportedOperationException
Set a different factory implementation to use for creating definitions when reading WSDL documents. As some WSDLReader implementations may only be capable of creating definitions using the same factory implementation from which the reader was obtained, this method is optional. Default is null.

Specified by:
setFactoryImplName in interface javax.wsdl.xml.WSDLReader
Parameters:
factoryImplName - the fully-qualified class name of the class which provides a concrete implementation of the abstract class WSDLFactory.
Throws:
java.lang.UnsupportedOperationException - if this method is invoked on an implementation which does not support it.

getFactoryImplName

public java.lang.String getFactoryImplName()
Get the factoryImplName, if one was set. Default is null.

Specified by:
getFactoryImplName in interface javax.wsdl.xml.WSDLReader

parseDefinitions

protected javax.wsdl.Definition parseDefinitions(java.lang.String documentBaseURI,
                                                 org.w3c.dom.Element defEl,
                                                 java.util.Map importedDefs)
                                          throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseImport

protected javax.wsdl.Import parseImport(org.w3c.dom.Element importEl,
                                        javax.wsdl.Definition def,
                                        java.util.Map importedDefs)
                                 throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseTypes

protected javax.wsdl.Types parseTypes(org.w3c.dom.Element typesEl,
                                      javax.wsdl.Definition def)
                               throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseSchema

protected javax.wsdl.extensions.ExtensibilityElement parseSchema(java.lang.Class parentType,
                                                                 org.w3c.dom.Element el,
                                                                 javax.wsdl.Definition def)
                                                          throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseSchema

protected javax.wsdl.extensions.ExtensibilityElement parseSchema(java.lang.Class parentType,
                                                                 org.w3c.dom.Element el,
                                                                 javax.wsdl.Definition def,
                                                                 javax.wsdl.extensions.ExtensionRegistry extReg)
                                                          throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseBinding

protected javax.wsdl.Binding parseBinding(org.w3c.dom.Element bindingEl,
                                          javax.wsdl.Definition def)
                                   throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseBindingOperation

protected javax.wsdl.BindingOperation parseBindingOperation(org.w3c.dom.Element bindingOperationEl,
                                                            javax.wsdl.PortType portType,
                                                            javax.wsdl.Definition def)
                                                     throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseBindingInput

protected javax.wsdl.BindingInput parseBindingInput(org.w3c.dom.Element bindingInputEl,
                                                    javax.wsdl.Definition def)
                                             throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseBindingOutput

protected javax.wsdl.BindingOutput parseBindingOutput(org.w3c.dom.Element bindingOutputEl,
                                                      javax.wsdl.Definition def)
                                               throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseBindingFault

protected javax.wsdl.BindingFault parseBindingFault(org.w3c.dom.Element bindingFaultEl,
                                                    javax.wsdl.Definition def)
                                             throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseMessage

protected javax.wsdl.Message parseMessage(org.w3c.dom.Element msgEl,
                                          javax.wsdl.Definition def)
                                   throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parsePart

protected javax.wsdl.Part parsePart(org.w3c.dom.Element partEl,
                                    javax.wsdl.Definition def)
                             throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseExtensibilityAttributes

protected void parseExtensibilityAttributes(org.w3c.dom.Element el,
                                            java.lang.Class parentType,
                                            javax.wsdl.extensions.AttributeExtensible attrExt,
                                            javax.wsdl.Definition def)
                                     throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseExtensibilityAttribute

protected java.lang.Object parseExtensibilityAttribute(org.w3c.dom.Element el,
                                                       int attrType,
                                                       java.lang.String attrValue,
                                                       javax.wsdl.Definition def)
                                                throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parsePortType

protected javax.wsdl.PortType parsePortType(org.w3c.dom.Element portTypeEl,
                                            javax.wsdl.Definition def)
                                     throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseOperation

protected javax.wsdl.Operation parseOperation(org.w3c.dom.Element opEl,
                                              javax.wsdl.PortType portType,
                                              javax.wsdl.Definition def)
                                       throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseService

protected javax.wsdl.Service parseService(org.w3c.dom.Element serviceEl,
                                          javax.wsdl.Definition def)
                                   throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parsePort

protected javax.wsdl.Port parsePort(org.w3c.dom.Element portEl,
                                    javax.wsdl.Definition def)
                             throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseExtensibilityElement

protected javax.wsdl.extensions.ExtensibilityElement parseExtensibilityElement(java.lang.Class parentType,
                                                                               org.w3c.dom.Element el,
                                                                               javax.wsdl.Definition def)
                                                                        throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseInput

protected javax.wsdl.Input parseInput(org.w3c.dom.Element inputEl,
                                      javax.wsdl.Definition def)
                               throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseOutput

protected javax.wsdl.Output parseOutput(org.w3c.dom.Element outputEl,
                                        javax.wsdl.Definition def)
                                 throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

parseFault

protected javax.wsdl.Fault parseFault(org.w3c.dom.Element faultEl,
                                      javax.wsdl.Definition def)
                               throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

readWSDL

public javax.wsdl.Definition readWSDL(java.lang.String wsdlURI)
                               throws javax.wsdl.WSDLException
Read the WSDL document accessible via the specified URI into a WSDL definition.

Specified by:
readWSDL in interface javax.wsdl.xml.WSDLReader
Parameters:
wsdlURI - a URI (can be a filename or URL) pointing to a WSDL XML definition.
Returns:
the definition.
Throws:
javax.wsdl.WSDLException

readWSDL

public javax.wsdl.Definition readWSDL(java.lang.String contextURI,
                                      java.lang.String wsdlURI)
                               throws javax.wsdl.WSDLException
Read the WSDL document accessible via the specified URI into a WSDL definition.

Specified by:
readWSDL in interface javax.wsdl.xml.WSDLReader
Parameters:
contextURI - the context in which to resolve the wsdlURI, if the wsdlURI is relative. Can be null, in which case it will be ignored.
wsdlURI - a URI (can be a filename or URL) pointing to a WSDL XML definition.
Returns:
the definition.
Throws:
javax.wsdl.WSDLException

readWSDL

public javax.wsdl.Definition readWSDL(java.lang.String documentBaseURI,
                                      org.w3c.dom.Element definitionsElement)
                               throws javax.wsdl.WSDLException
Read the specified <wsdl:definitions> element into a WSDL definition.

Specified by:
readWSDL in interface javax.wsdl.xml.WSDLReader
Parameters:
documentBaseURI - the document base URI of the WSDL definition described by the element. Will be set as the documentBaseURI of the returned Definition. Can be null, in which case it will be ignored.
definitionsElement - the <wsdl:definitions> element
Returns:
the definition described by the element.
Throws:
javax.wsdl.WSDLException

readWSDL

public javax.wsdl.Definition readWSDL(javax.wsdl.xml.WSDLLocator locator,
                                      org.w3c.dom.Element definitionsElement)
                               throws javax.wsdl.WSDLException
Read the specified <wsdl:definitions> element into a WSDL definition. The WSDLLocator is used to provide the document base URIs. The InputSource of the WSDLLocator is ignored, instead the WSDL is parsed from the given Element.

Specified by:
readWSDL in interface javax.wsdl.xml.WSDLReader
Parameters:
locator - A WSDLLocator object used to provide the document base URI of the WSDL definition described by the element.
definitionsElement - the <wsdl:definitions> element
Returns:
the definition described by the element.
Throws:
javax.wsdl.WSDLException

readWSDL

protected javax.wsdl.Definition readWSDL(java.lang.String documentBaseURI,
                                         org.w3c.dom.Element definitionsElement,
                                         java.util.Map importedDefs)
                                  throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

readWSDL

public javax.wsdl.Definition readWSDL(java.lang.String documentBaseURI,
                                      org.w3c.dom.Document wsdlDocument)
                               throws javax.wsdl.WSDLException
Read the specified WSDL document into a WSDL definition.

Specified by:
readWSDL in interface javax.wsdl.xml.WSDLReader
Parameters:
documentBaseURI - the document base URI of the WSDL definition described by the document. Will be set as the documentBaseURI of the returned Definition. Can be null, in which case it will be ignored.
wsdlDocument - the WSDL document, an XML document obeying the WSDL schema.
Returns:
the definition described in the document.
Throws:
javax.wsdl.WSDLException

readWSDL

public javax.wsdl.Definition readWSDL(java.lang.String documentBaseURI,
                                      org.xml.sax.InputSource inputSource)
                               throws javax.wsdl.WSDLException
Read a WSDL document into a WSDL definition.

Specified by:
readWSDL in interface javax.wsdl.xml.WSDLReader
Parameters:
documentBaseURI - the document base URI of the WSDL definition described by the document. Will be set as the documentBaseURI of the returned Definition. Can be null, in which case it will be ignored.
inputSource - an InputSource pointing to the WSDL document, an XML document obeying the WSDL schema.
Returns:
the definition described in the document pointed to by the InputSource.
Throws:
javax.wsdl.WSDLException

readWSDL

public javax.wsdl.Definition readWSDL(javax.wsdl.xml.WSDLLocator locator)
                               throws javax.wsdl.WSDLException
Read a WSDL document into a WSDL definition.

Specified by:
readWSDL in interface javax.wsdl.xml.WSDLReader
Parameters:
locator - A WSDLLocator object used to provide InputSources pointing to the wsdl file.
Returns:
the definition described in the document
Throws:
javax.wsdl.WSDLException