Package com.ibm.wsdl.xml
Class WSDLReaderImpl
- java.lang.Object
-
- com.ibm.wsdl.xml.WSDLReaderImpl
-
- All Implemented Interfaces:
WSDLReader
public class WSDLReaderImpl extends java.lang.Object implements WSDLReader
This class describes a collection of methods that enable conversion of a WSDL document (in XML, following the WSDL schema described in the WSDL specification) into a WSDL model.- Author:
- Matthew J. Duftler, Nirmal Mukhi
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map
allSchemas
protected ExtensionRegistry
extReg
protected WSDLFactory
factory
protected java.lang.String
factoryImplName
protected boolean
importDocuments
protected WSDLLocator
loc
protected boolean
parseSchema
protected boolean
verbose
-
Constructor Summary
Constructors Constructor Description WSDLReaderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 WSDLFactory
getWSDLFactory()
Get the WSDLFactory object cached in the reader, or use lazy instantiation if it is not cached yet.protected Binding
parseBinding(org.w3c.dom.Element bindingEl, Definition def)
protected BindingFault
parseBindingFault(org.w3c.dom.Element bindingFaultEl, Definition def)
protected BindingInput
parseBindingInput(org.w3c.dom.Element bindingInputEl, Definition def)
protected BindingOperation
parseBindingOperation(org.w3c.dom.Element bindingOperationEl, PortType portType, Definition def)
protected BindingOutput
parseBindingOutput(org.w3c.dom.Element bindingOutputEl, Definition def)
protected 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, Definition def)
protected void
parseExtensibilityAttributes(org.w3c.dom.Element el, java.lang.Class parentType, AttributeExtensible attrExt, Definition def)
protected ExtensibilityElement
parseExtensibilityElement(java.lang.Class parentType, org.w3c.dom.Element el, Definition def)
protected ExtensibilityElement
parseExtensibilityElementAsDefaultExtensiblityElement(java.lang.Class parentType, org.w3c.dom.Element el, Definition def)
Parse the element using the ExtensionRegistry default deserializer instead using the one registered.protected Fault
parseFault(org.w3c.dom.Element faultEl, Definition def)
protected Import
parseImport(org.w3c.dom.Element importEl, Definition def, java.util.Map importedDefs)
protected Input
parseInput(org.w3c.dom.Element inputEl, Definition def)
protected Message
parseMessage(org.w3c.dom.Element msgEl, Definition def)
protected Operation
parseOperation(org.w3c.dom.Element opEl, PortType portType, Definition def)
protected Output
parseOutput(org.w3c.dom.Element outputEl, Definition def)
protected Part
parsePart(org.w3c.dom.Element partEl, Definition def)
protected Port
parsePort(org.w3c.dom.Element portEl, Definition def)
protected PortType
parsePortType(org.w3c.dom.Element portTypeEl, Definition def)
protected ExtensibilityElement
parseSchema(java.lang.Class parentType, org.w3c.dom.Element el, Definition def)
protected ExtensibilityElement
parseSchema(java.lang.Class parentType, org.w3c.dom.Element el, Definition def, ExtensionRegistry extReg)
protected Service
parseService(org.w3c.dom.Element serviceEl, Definition def)
protected Types
parseTypes(org.w3c.dom.Element typesEl, Definition def)
Definition
readWSDL(java.lang.String wsdlURI)
Read the WSDL document accessible via the specified URI into a WSDL definition.Definition
readWSDL(java.lang.String contextURI, java.lang.String wsdlURI)
Read the WSDL document accessible via the specified URI into a WSDL definition.Definition
readWSDL(java.lang.String documentBaseURI, org.w3c.dom.Document wsdlDocument)
Read the specified WSDL document into a WSDL definition.Definition
readWSDL(java.lang.String documentBaseURI, org.w3c.dom.Element definitionsElement)
Read the specified <wsdl:definitions> element into a WSDL definition.protected Definition
readWSDL(java.lang.String documentBaseURI, org.w3c.dom.Element definitionsElement, java.util.Map importedDefs)
Definition
readWSDL(java.lang.String documentBaseURI, org.xml.sax.InputSource inputSource)
Read a WSDL document into a WSDL definition.Definition
readWSDL(WSDLLocator locator)
Read a WSDL document into a WSDL definition.Definition
readWSDL(WSDLLocator locator, org.w3c.dom.Element definitionsElement)
Read the specified <wsdl:definitions> element into a WSDL definition.void
setExtensionRegistry(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.
-
-
-
Field Detail
-
verbose
protected boolean verbose
-
importDocuments
protected boolean importDocuments
-
parseSchema
protected boolean parseSchema
-
extReg
protected ExtensionRegistry extReg
-
factoryImplName
protected java.lang.String factoryImplName
-
loc
protected WSDLLocator loc
-
factory
protected WSDLFactory factory
-
allSchemas
protected java.util.Map allSchemas
-
-
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.verbose If set to true, status messages will be displayed. true javax.wsdl.importDocuments If set to true, imported WSDL documents will be retrieved and processed. true com.ibm.wsdl.parseXMLSchemas If set to true, the schema documents inlined and import directly or indirectly will be retrieved as javax.wsdl.extensions.schema.Schema objects and referred to in the Definition. This is the default (only) behaviour from JWSDL 1.2. Which is why the default for this feature is true. However, prior to JWSDL 1.2 the only behaviour was not to parse the schema files. Setting this feature to false will prevent the schemas being parsed. 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 interfaceWSDLReader
- 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 interfaceWSDLReader
- 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(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 interfaceWSDLReader
- Parameters:
extReg
- the extension registry to use for new definitions
-
getExtensionRegistry
public ExtensionRegistry getExtensionRegistry()
Get the extension registry, if one was set. Default is null.- Specified by:
getExtensionRegistry
in interfaceWSDLReader
-
getWSDLFactory
protected WSDLFactory getWSDLFactory() throws WSDLException
Get the WSDLFactory object cached in the reader, or use lazy instantiation if it is not cached yet.- Throws:
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 interfaceWSDLReader
- 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 interfaceWSDLReader
-
parseDefinitions
protected Definition parseDefinitions(java.lang.String documentBaseURI, org.w3c.dom.Element defEl, java.util.Map importedDefs) throws WSDLException
- Throws:
WSDLException
-
parseImport
protected Import parseImport(org.w3c.dom.Element importEl, Definition def, java.util.Map importedDefs) throws WSDLException
- Throws:
WSDLException
-
parseTypes
protected Types parseTypes(org.w3c.dom.Element typesEl, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseSchema
protected ExtensibilityElement parseSchema(java.lang.Class parentType, org.w3c.dom.Element el, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseSchema
protected ExtensibilityElement parseSchema(java.lang.Class parentType, org.w3c.dom.Element el, Definition def, ExtensionRegistry extReg) throws WSDLException
- Throws:
WSDLException
-
parseBinding
protected Binding parseBinding(org.w3c.dom.Element bindingEl, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseBindingOperation
protected BindingOperation parseBindingOperation(org.w3c.dom.Element bindingOperationEl, PortType portType, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseBindingInput
protected BindingInput parseBindingInput(org.w3c.dom.Element bindingInputEl, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseBindingOutput
protected BindingOutput parseBindingOutput(org.w3c.dom.Element bindingOutputEl, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseBindingFault
protected BindingFault parseBindingFault(org.w3c.dom.Element bindingFaultEl, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseMessage
protected Message parseMessage(org.w3c.dom.Element msgEl, Definition def) throws WSDLException
- Throws:
WSDLException
-
parsePart
protected Part parsePart(org.w3c.dom.Element partEl, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseExtensibilityAttributes
protected void parseExtensibilityAttributes(org.w3c.dom.Element el, java.lang.Class parentType, AttributeExtensible attrExt, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseExtensibilityAttribute
protected java.lang.Object parseExtensibilityAttribute(org.w3c.dom.Element el, int attrType, java.lang.String attrValue, Definition def) throws WSDLException
- Throws:
WSDLException
-
parsePortType
protected PortType parsePortType(org.w3c.dom.Element portTypeEl, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseOperation
protected Operation parseOperation(org.w3c.dom.Element opEl, PortType portType, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseService
protected Service parseService(org.w3c.dom.Element serviceEl, Definition def) throws WSDLException
- Throws:
WSDLException
-
parsePort
protected Port parsePort(org.w3c.dom.Element portEl, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseExtensibilityElement
protected ExtensibilityElement parseExtensibilityElement(java.lang.Class parentType, org.w3c.dom.Element el, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseExtensibilityElementAsDefaultExtensiblityElement
protected ExtensibilityElement parseExtensibilityElementAsDefaultExtensiblityElement(java.lang.Class parentType, org.w3c.dom.Element el, Definition def) throws WSDLException
Parse the element using the ExtensionRegistry default deserializer instead using the one registered. The default deserializer will create an UnknownExtensibilityElement from the element.- Parameters:
parentType
-el
-def
-- Returns:
- An instance of the default ExtensibilityElement as registered with the ExtensionRegistry
- Throws:
WSDLException
-
parseInput
protected Input parseInput(org.w3c.dom.Element inputEl, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseOutput
protected Output parseOutput(org.w3c.dom.Element outputEl, Definition def) throws WSDLException
- Throws:
WSDLException
-
parseFault
protected Fault parseFault(org.w3c.dom.Element faultEl, Definition def) throws WSDLException
- Throws:
WSDLException
-
readWSDL
public Definition readWSDL(java.lang.String wsdlURI) throws WSDLException
Read the WSDL document accessible via the specified URI into a WSDL definition.- Specified by:
readWSDL
in interfaceWSDLReader
- Parameters:
wsdlURI
- a URI (can be a filename or URL) pointing to a WSDL XML definition.- Returns:
- the definition.
- Throws:
WSDLException
-
readWSDL
public Definition readWSDL(java.lang.String contextURI, java.lang.String wsdlURI) throws WSDLException
Read the WSDL document accessible via the specified URI into a WSDL definition.- Specified by:
readWSDL
in interfaceWSDLReader
- 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:
WSDLException
-
readWSDL
public Definition readWSDL(java.lang.String documentBaseURI, org.w3c.dom.Element definitionsElement) throws WSDLException
Read the specified <wsdl:definitions> element into a WSDL definition.- Specified by:
readWSDL
in interfaceWSDLReader
- 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:
WSDLException
-
readWSDL
public Definition readWSDL(WSDLLocator locator, org.w3c.dom.Element definitionsElement) throws 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 interfaceWSDLReader
- 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:
WSDLException
-
readWSDL
protected Definition readWSDL(java.lang.String documentBaseURI, org.w3c.dom.Element definitionsElement, java.util.Map importedDefs) throws WSDLException
- Throws:
WSDLException
-
readWSDL
public Definition readWSDL(java.lang.String documentBaseURI, org.w3c.dom.Document wsdlDocument) throws WSDLException
Read the specified WSDL document into a WSDL definition.- Specified by:
readWSDL
in interfaceWSDLReader
- 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:
WSDLException
-
readWSDL
public Definition readWSDL(java.lang.String documentBaseURI, org.xml.sax.InputSource inputSource) throws WSDLException
Read a WSDL document into a WSDL definition.- Specified by:
readWSDL
in interfaceWSDLReader
- 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:
WSDLException
-
readWSDL
public Definition readWSDL(WSDLLocator locator) throws WSDLException
Read a WSDL document into a WSDL definition.- Specified by:
readWSDL
in interfaceWSDLReader
- Parameters:
locator
- A WSDLLocator object used to provide InputSources pointing to the wsdl file.- Returns:
- the definition described in the document
- Throws:
WSDLException
-
-