Author: jkaputin
Date: Tue Oct 17 13:12:54 2006
New Revision: 465024

URL: http://svn.apache.org/viewvc?view=rev&rev=465024
Log:
Refactored some of the parseXXX and helper methods from
DOMWSDLReader into BaseWSDLReader.

Modified:
    
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/BaseWSDLReader.java
    
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/DOMWSDLReader.java

Modified: 
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/BaseWSDLReader.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/BaseWSDLReader.java?view=diff&rev=465024&r1=465023&r2=465024
==============================================================================
--- 
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/BaseWSDLReader.java
 (original)
+++ 
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/BaseWSDLReader.java
 Tue Oct 17 13:12:54 2006
@@ -15,12 +15,52 @@
  */
 package org.apache.woden.internal;
 
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
 import org.apache.woden.XMLElement;
 import org.apache.woden.ErrorReporter;
 import org.apache.woden.WSDLException;
 import org.apache.woden.WSDLFactory;
 import org.apache.woden.WSDLReader;
+import org.apache.woden.internal.schema.SchemaConstants;
+import org.apache.woden.internal.util.StringUtils;
+import org.apache.woden.internal.wsdl20.Constants;
+import org.apache.woden.schema.Schema;
+import org.apache.woden.types.NCName;
+import org.apache.woden.wsdl20.enumeration.Direction;
+import org.apache.woden.wsdl20.enumeration.MessageLabel;
+import org.apache.woden.wsdl20.extensions.ExtensionDeserializer;
+import org.apache.woden.wsdl20.extensions.ExtensionElement;
 import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
+import org.apache.woden.wsdl20.xml.BindingElement;
+import org.apache.woden.wsdl20.xml.BindingFaultElement;
+import org.apache.woden.wsdl20.xml.BindingFaultReferenceElement;
+import org.apache.woden.wsdl20.xml.BindingMessageReferenceElement;
+import org.apache.woden.wsdl20.xml.BindingOperationElement;
+import org.apache.woden.wsdl20.xml.ConfigurableElement;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+import org.apache.woden.wsdl20.xml.DocumentableElement;
+import org.apache.woden.wsdl20.xml.DocumentationElement;
+import org.apache.woden.wsdl20.xml.EndpointElement;
+import org.apache.woden.wsdl20.xml.FeatureElement;
+import org.apache.woden.wsdl20.xml.ImportElement;
+import org.apache.woden.wsdl20.xml.IncludeElement;
+import org.apache.woden.wsdl20.xml.InterfaceElement;
+import org.apache.woden.wsdl20.xml.InterfaceFaultElement;
+import org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement;
+import org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement;
+import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
+import org.apache.woden.wsdl20.xml.PropertyElement;
+import org.apache.woden.wsdl20.xml.ServiceElement;
+import org.apache.woden.wsdl20.xml.TypesElement;
+import org.apache.woden.wsdl20.xml.WSDLElement;
 
 
 /**
@@ -49,17 +89,9 @@
         features = new ReaderFeatures();
     }
     
-    /**
-     * Returns an XMLElement object representing the specified element
-     * object. The element object argument must be compatible with the 
-     * concrete reader implementation. If so, this method returns an XMLElement
-     * object that is type-compatible with the reader implementatation (e.g. a
-     * DOMXMLElement for DOMWSDLReader).
-     * 
-     * @throws IllegalArgumentException if elem is not a type recognized by 
the 
-     * WSDLReader implementation.
-     */
-    abstract protected XMLElement createXMLElement(Object elem) throws 
IllegalArgumentException;
+    /* ************************************************************
+     *  API public methods
+     * ************************************************************/
     
     /**
      * @return Returns the fErrorReporter.
@@ -254,5 +286,1393 @@
                     fErrorReporter.getFormattedMessage("WSDL008", args));
         }
     }
-    
+
+    /* ************************************************************
+     *  Parsing methods - e.g. parseXXXX()
+     * ************************************************************/
+
+    /* Parse the attributes and child elements of the <description> element.
+     * As per the WSDL 2.0 spec, the child elements must be in the 
+     * following order if present:
+     * <documentation>
+     * <import> <include> or WSDL extension elements in any order
+     * <types>
+     * <interface> <binding> <service> or WSDL extension elements in any order.
+     * TODO validate that the elements are in correct order
+     */ 
+    protected DescriptionElement parseDescription(
+            String documentBaseURI, 
+            XMLElement descEl, 
+            Map wsdlModules) 
+            throws WSDLException {
+
+        if (!Constants.Q_ELEM_DESCRIPTION.equals(descEl.getQName()))
+        {
+            getErrorReporter().reportError(
+                new ErrorLocatorImpl(),  //TODO line&col nos.
+                "WSDL501", 
+                new Object[] {Constants.Q_ELEM_DESCRIPTION, descEl.getQName()},
+                ErrorReporter.SEVERITY_FATAL_ERROR);
+        }
+        
+        DescriptionElement desc = 
+            ((DOMWSDLFactory)getFactory()).newDescription();
+        
+        if(wsdlModules == null) 
+        {
+            //This is the initial WSDL document. No imports or includes yet.
+            //TODO this might be the place to flag the initial Desc if 
necessary.
+            wsdlModules = new HashMap();
+        }
+        
+        if(getExtensionRegistry() != null) 
+        {
+            desc.setExtensionRegistry(getExtensionRegistry());
+        }
+        
+        if(getErrorReporter() != null) 
+        {
+            (desc.getExtensionRegistry()).setErrorReporter(getErrorReporter());
+        }
+        
+        desc.setDocumentBaseURI(getURI(documentBaseURI));
+
+        String targetNamespace = 
+            descEl.getAttribute(Constants.ATTR_TARGET_NAMESPACE);
+        
+        if(targetNamespace != null)
+        {
+            desc.setTargetNamespace(getURI(targetNamespace));
+        }
+        
+        parseNamespaceDeclarations(descEl, desc);
+        
+        parseExtensionAttributes(descEl, DescriptionElement.class, desc, desc);
+        
+        //parse the child elements
+        XMLElement tempEl = descEl.getFirstChildElement();
+        QName tempElQN = null;
+
+        while (tempEl != null)
+        {
+               tempElQN = tempEl.getQName();
+               
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+            {
+                parseDocumentation(tempEl, desc, desc);
+            }
+            else if (Constants.Q_ELEM_IMPORT.equals(tempElQN))
+            {
+                if(documentBaseURI != null && 
!wsdlModules.containsKey(documentBaseURI)) 
+                {
+                    wsdlModules.put(documentBaseURI, desc);
+                }
+                parseImport(tempEl, desc, wsdlModules);
+            }
+            else if (Constants.Q_ELEM_INCLUDE.equals(tempElQN))
+            {
+                if(documentBaseURI != null && 
!wsdlModules.containsKey(documentBaseURI)) 
+                {
+                    wsdlModules.put(documentBaseURI, desc);
+                }
+                parseInclude(tempEl, desc, wsdlModules);
+            }
+            else if (Constants.Q_ELEM_TYPES.equals(tempElQN))
+            {
+                parseTypes(tempEl, desc);
+            }
+            else if (Constants.Q_ELEM_INTERFACE.equals(tempElQN))
+            {
+                parseInterface(tempEl, desc);
+            }
+            else if (Constants.Q_ELEM_BINDING.equals(tempElQN))
+            {
+                parseBinding(tempEl, desc);
+            }
+            else if (Constants.Q_ELEM_SERVICE.equals(tempElQN))
+            {
+                parseService(tempEl, desc);
+            }
+            else
+            {
+                desc.addExtensionElement(
+                    parseExtensionElement(DescriptionElement.class, desc, 
tempEl, desc) );
+            }
+            
+            tempEl = tempEl.getNextSiblingElement();
+        }
+        
+        parseSchemaForXMLSchema(desc);  //TODO temporary - see comments within 
the method
+        
+        return desc;
+    }
+
+    protected DocumentationElement parseDocumentation(
+            XMLElement docEl, 
+            DescriptionElement desc, 
+            DocumentableElement parent) 
+            throws WSDLException {
+
+        DocumentationElement documentation = parent.addDocumentationElement();
+
+        //TODO store docEl as below, or just extract any text? 
+        documentation.setContent(docEl.getSource());
+
+        //Now parse any extensibility attributes or elements
+
+        parseExtensionAttributes(docEl, DocumentationElement.class, 
documentation, desc);
+
+        XMLElement tempEl = docEl.getFirstChildElement();
+
+        while (tempEl != null)
+        {
+            documentation.addExtensionElement(
+                    parseExtensionElement(DocumentationElement.class, 
documentation, tempEl, desc) );
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return documentation;
+    }
+
+    private ImportElement parseImport(
+            XMLElement importEl,
+            DescriptionElement desc,
+            Map wsdlModules) 
+            throws WSDLException {
+
+        ImportElement imp = desc.addImportElement();
+
+        String namespaceURI = importEl.getAttribute(Constants.ATTR_NAMESPACE);
+        String locationURI = importEl.getAttribute(Constants.ATTR_LOCATION);
+
+        parseExtensionAttributes(importEl, ImportElement.class, imp, desc);
+
+        if(namespaceURI != null) 
+        {
+            //TODO handle missing namespace attribute (REQUIRED attr)
+            imp.setNamespace(getURI(namespaceURI));
+        }
+
+        if(locationURI != null)
+        {
+            //TODO handle missing locationURI (OPTIONAL attr)
+            imp.setLocation(getURI(locationURI));
+            DescriptionElement importedDesc = 
+                getWSDLFromLocation(locationURI, desc, wsdlModules);
+            imp.setDescriptionElement(importedDesc);
+        }
+
+        return imp;
+    }
+
+    private IncludeElement parseInclude(
+            XMLElement includeEl,
+            DescriptionElement desc,
+            Map wsdlModules) 
+            throws WSDLException {
+
+        IncludeElement include = desc.addIncludeElement();
+
+        String locationURI = includeEl.getAttribute(Constants.ATTR_LOCATION);
+
+        parseExtensionAttributes(includeEl, IncludeElement.class, include, 
desc);
+
+        if(locationURI != null)
+        {
+            include.setLocation(getURI(locationURI));
+            DescriptionElement includedDesc = 
+                getWSDLFromLocation(locationURI, desc, wsdlModules);
+            include.setDescriptionElement(includedDesc);
+        }
+
+        return include;
+    }
+
+    /*
+     * TODO Initial schema parsing is specific to XML Schema. 
+     * Need generic support for other type systems.
+     * Consider extension architecture with serializer/deserializer.
+     */
+    private TypesElement parseTypes(
+            XMLElement typesEl,
+            DescriptionElement desc) 
+            throws WSDLException {
+
+        TypesElement types = desc.getTypesElement();
+
+        //TODO for now set to W3 XML Schema. Later, add support for non-XML 
Schema type systems
+        types.setTypeSystem(Constants.TYPE_XSD_2001);
+
+        parseExtensionAttributes(typesEl, TypesElement.class, types, desc);
+
+        XMLElement tempEl = typesEl.getFirstChildElement();
+        QName tempElQN = null;
+
+        while (tempEl != null)
+        {
+            tempElQN = tempEl.getQName();
+
+            //TODO validate element order? <documentation> must be first.
+
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+            {
+                parseDocumentation(tempEl, desc, types);
+            }
+            else if (SchemaConstants.XSD_IMPORT_QNAME_LIST.contains(tempElQN))
+            {
+                types.addSchema(parseSchemaImport(tempEl, desc));
+            }
+            else if (SchemaConstants.XSD_SCHEMA_QNAME_LIST.contains(tempElQN))
+            {
+                types.addSchema(parseSchemaInline(tempEl, desc));
+            }
+            else
+            {
+                types.addExtensionElement(
+                        parseExtensionElement(TypesElement.class, types, 
tempEl, desc) );
+            }
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return types;
+    }
+
+    protected abstract Schema parseSchemaImport(
+            XMLElement importEl,
+            DescriptionElement desc) 
+            throws WSDLException;
+
+    protected abstract Schema parseSchemaInline(
+            XMLElement schemaEl,
+            DescriptionElement desc) 
+            throws WSDLException;
+
+    private InterfaceElement parseInterface(
+            XMLElement interfaceEl,
+            DescriptionElement desc) 
+            throws WSDLException {
+        
+        InterfaceElement intface = desc.addInterfaceElement();
+
+        String name = interfaceEl.getAttribute(Constants.ATTR_NAME);
+
+        if(name != null)
+        {
+            intface.setName(new NCName(name));
+        }
+
+        String styleDefault = 
interfaceEl.getAttribute(Constants.ATTR_STYLE_DEFAULT);
+        if(styleDefault != null)
+        {
+            List stringList = StringUtils.parseNMTokens(styleDefault);
+            String uriString = null;
+            Iterator it = stringList.iterator();
+            while(it.hasNext())
+            {
+                uriString = (String)it.next();
+                intface.addStyleDefaultURI(getURI(uriString));
+            }
+        }
+
+        String extendsAtt = interfaceEl.getAttribute(Constants.ATTR_EXTENDS);
+        if(extendsAtt != null)
+        {
+            List stringList = StringUtils.parseNMTokens(extendsAtt);
+            String qnString = null;
+            Iterator it = stringList.iterator();
+            while(it.hasNext())
+            {
+                qnString = (String)it.next();
+                
intface.addExtendedInterfaceName(interfaceEl.getQName(qnString));
+            }
+        }
+
+        parseExtensionAttributes(interfaceEl, InterfaceElement.class, intface, 
desc);
+
+        /* Parse the child elements of <interface>. 
+         * As per WSDL 2.0 spec, they must be in the following order if 
present:
+         * <documentation>
+         * <fault> <operation> <feature> <property> or extension elements in 
any order
+         * TODO validate that the elements are in correct order
+         */ 
+
+        XMLElement tempEl = interfaceEl.getFirstChildElement();
+        QName tempElQN = null;
+
+        while (tempEl != null)
+        {
+            tempElQN = tempEl.getQName();
+
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+            {
+                parseDocumentation(tempEl, desc, intface);
+            }
+            else if (Constants.Q_ELEM_FAULT.equals(tempElQN))
+            {
+                parseInterfaceFault(tempEl, desc, intface);
+            }
+            else if (Constants.Q_ELEM_OPERATION.equals(tempElQN))
+            {
+                parseInterfaceOperation(tempEl, desc, intface);
+            }
+            else if (Constants.Q_ELEM_FEATURE.equals(tempElQN))
+            {
+                parseFeature(tempEl, desc, intface);
+            }
+            else if (Constants.Q_ELEM_PROPERTY.equals(tempElQN))
+            {
+                parseProperty(tempEl, desc, intface);
+            }
+            else
+            {
+                intface.addExtensionElement(
+                        parseExtensionElement(InterfaceElement.class, intface, 
tempEl, desc) );
+            }
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return intface;
+    }
+
+    /* Parse the attributes and child elements of interface <fault>. 
+     * As per WSDL 2.0 spec, the child elements must be in the following order 
if present:
+     * <documentation>
+     * <feature> <property> or extension elements in any order
+     * 
+     * TODO validate that the elements are in correct order
+     */ 
+    private InterfaceFaultElement parseInterfaceFault(
+            XMLElement faultEl,
+            DescriptionElement desc,
+            InterfaceElement parent) 
+            throws WSDLException {
+
+        InterfaceFaultElement fault = parent.addInterfaceFaultElement();
+        fault.setParentElement(parent);
+
+        String name = faultEl.getAttribute(Constants.ATTR_NAME);
+        if(name != null)
+        {
+            fault.setName(new NCName(name));
+        }
+
+        String element = faultEl.getAttribute(Constants.ATTR_ELEMENT);
+        if(element != null)
+        {
+            try {
+                QName qname = faultEl.getQName(element);
+                fault.setElementName(qname);
+            } catch (WSDLException e) {
+                getErrorReporter().reportError( 
+                        new ErrorLocatorImpl(),  //TODO line&col nos.
+                        "WSDL505",
+                        new Object[] {element, faultEl.getQName()},
+                        ErrorReporter.SEVERITY_ERROR);
+            }
+        }
+
+        parseExtensionAttributes(faultEl, InterfaceFaultElement.class, fault, 
desc);
+
+        XMLElement tempEl = faultEl.getFirstChildElement();
+        QName tempElQN = null;
+
+        while (tempEl != null)
+        {
+            tempElQN = tempEl.getQName();
+
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+            {
+                parseDocumentation(tempEl, desc, fault);
+            }
+            else if (Constants.Q_ELEM_FEATURE.equals(tempElQN))
+            {
+                parseFeature(tempEl, desc, fault);
+            }
+            else if (Constants.Q_ELEM_PROPERTY.equals(tempElQN))
+            {
+                parseProperty(tempEl, desc, fault);
+            }
+            else
+            {
+                fault.addExtensionElement(
+                        parseExtensionElement(InterfaceFaultElement.class, 
fault, tempEl, desc) );
+            }
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return fault;
+    }
+
+    private InterfaceOperationElement parseInterfaceOperation(
+            XMLElement operEl, 
+            DescriptionElement desc,
+            InterfaceElement parent) 
+            throws WSDLException {
+
+        InterfaceOperationElement oper = parent.addInterfaceOperationElement();
+        oper.setParentElement(parent);
+
+        String name = operEl.getAttribute(Constants.ATTR_NAME);
+        if(name != null)
+        {
+            oper.setName(new NCName(name));
+        }
+
+        String style = operEl.getAttribute(Constants.ATTR_STYLE);
+        if(style != null)
+        {
+            List stringList = StringUtils.parseNMTokens(style);
+            String uriString = null;
+            Iterator it = stringList.iterator();
+            while(it.hasNext())
+            {
+                uriString = (String)it.next();
+                oper.addStyleURI(getURI(uriString));
+            }
+        }
+
+        String pat = operEl.getAttribute(Constants.ATTR_PATTERN);
+        if(pat != null)
+        {
+            oper.setPattern(getURI(pat));
+        }
+
+        parseExtensionAttributes(operEl, InterfaceOperationElement.class, 
oper, desc);
+
+        /* Parse the child elements of interface <operation>. 
+         * As per WSDL 2.0 spec, they must be in the following order if 
present:
+         * <documentation> 
+         * <input> <output> <infault> <outfault> <feature> <property> or 
extension elements in any order
+         * TODO validate that the elements are in correct order
+         */ 
+
+        XMLElement tempEl = operEl.getFirstChildElement();
+        QName tempElQN = null;
+
+        while (tempEl != null)
+        {
+            tempElQN = tempEl.getQName();
+
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+            {
+                parseDocumentation(tempEl, desc, oper);
+            }
+            else if (Constants.Q_ELEM_FEATURE.equals(tempElQN))
+            {
+                parseFeature(tempEl, desc, oper);
+            }
+            else if (Constants.Q_ELEM_PROPERTY.equals(tempElQN))
+            {
+                parseProperty(tempEl, desc, oper);
+            }
+            else if (Constants.Q_ELEM_INPUT.equals(tempElQN))
+            {
+                parseInterfaceMessageReference(tempEl, desc, oper);
+            }
+            else if (Constants.Q_ELEM_OUTPUT.equals(tempElQN))
+            {
+                parseInterfaceMessageReference(tempEl, desc, oper);
+            }
+            else if (Constants.Q_ELEM_INFAULT.equals(tempElQN))
+            {
+                parseInterfaceFaultReference(tempEl, desc, oper);
+            }
+            else if (Constants.Q_ELEM_OUTFAULT.equals(tempElQN))
+            {
+                parseInterfaceFaultReference(tempEl, desc, oper);
+            }
+            else
+            {
+                oper.addExtensionElement(
+                        parseExtensionElement(InterfaceOperationElement.class, 
oper, tempEl, desc) );
+            }
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return oper;
+    }
+
+    private InterfaceFaultReferenceElement parseInterfaceFaultReference(
+            XMLElement faultRefEl,
+            DescriptionElement desc,
+            InterfaceOperationElement parent)
+            throws WSDLException {
+
+        InterfaceFaultReferenceElement faultRef = 
parent.addInterfaceFaultReferenceElement();
+        faultRef.setParentElement(parent);
+
+        if(Constants.ELEM_INFAULT.equals(faultRefEl.getLocalName())) {
+            faultRef.setDirection(Direction.IN);
+        } 
+        else if(Constants.ELEM_OUTFAULT.equals(faultRefEl.getLocalName())){
+            faultRef.setDirection(Direction.OUT);
+        }
+
+        String ref = faultRefEl.getAttribute(Constants.ATTR_REF);
+        if(ref != null)
+        {
+            try {
+                QName qname = faultRefEl.getQName(ref);
+                faultRef.setRef(qname);
+            } catch (WSDLException e) {
+                getErrorReporter().reportError( 
+                        new ErrorLocatorImpl(),  //TODO line&col nos.
+                        "WSDL505",
+                        new Object[] {ref, faultRefEl.getQName()},
+                        ErrorReporter.SEVERITY_ERROR);
+            }
+        }
+
+        String msgLabel = 
faultRefEl.getAttribute(Constants.ATTR_MESSAGE_LABEL);
+        if(msgLabel != null)
+        {
+            faultRef.setMessageLabel(new NCName(msgLabel));
+        }
+
+        parseExtensionAttributes(faultRefEl, 
InterfaceFaultReferenceElement.class, faultRef, desc);
+
+        XMLElement tempEl = faultRefEl.getFirstChildElement();
+        QName tempElQN = null;
+
+        while (tempEl != null)
+        {
+            tempElQN = tempEl.getQName();
+
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+            {
+                parseDocumentation(tempEl, desc, faultRef);
+            }
+            else if (Constants.Q_ELEM_FEATURE.equals(tempElQN))
+            {
+                parseFeature(tempEl, desc, faultRef);
+            }
+            else if (Constants.Q_ELEM_PROPERTY.equals(tempElQN))
+            {
+                parseProperty(tempEl, desc, faultRef);
+            }
+            else
+            {
+                faultRef.addExtensionElement(
+                        
parseExtensionElement(InterfaceFaultReferenceElement.class, faultRef, tempEl, 
desc) );
+            }
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return faultRef;
+    }
+
+    private InterfaceMessageReferenceElement parseInterfaceMessageReference(
+            XMLElement msgRefEl,
+            DescriptionElement desc,
+            InterfaceOperationElement parent)
+            throws WSDLException {
+
+        InterfaceMessageReferenceElement message = 
parent.addInterfaceMessageReferenceElement();
+        message.setParentElement(parent);
+
+        if(Constants.ELEM_INPUT.equals(msgRefEl.getLocalName())) {
+            message.setDirection(Direction.IN);
+        } 
+        else if(Constants.ELEM_OUTPUT.equals(msgRefEl.getLocalName())) {
+            message.setDirection(Direction.OUT);
+        }
+
+        String msgLabel = msgRefEl.getAttribute(Constants.ATTR_MESSAGE_LABEL);
+        if(msgLabel != null) 
+        {
+            message.setMessageLabel(new NCName(msgLabel));
+        }
+        else
+        {
+            //TODO this is a temp fix, correct action to use MEP to determine 
default
+            if(message.getDirection().equals(Direction.IN))
+            {
+                message.setMessageLabel(MessageLabel.IN);
+            }
+            else
+            {
+                message.setMessageLabel(MessageLabel.OUT);
+            }
+        }
+
+        String element = msgRefEl.getAttribute(Constants.ATTR_ELEMENT);
+        if(element != null)
+        {
+            if(element.equals(Constants.NMTOKEN_ANY) ||
+                    element.equals(Constants.NMTOKEN_NONE) ||
+                    element.equals(Constants.NMTOKEN_OTHER))
+            {
+                message.setMessageContentModel(element);
+            }
+            else
+            {
+                //element is not #any, #none or #other, so it must be an 
element qname
+                message.setMessageContentModel(Constants.NMTOKEN_ELEMENT);
+                try {
+                    QName qname = msgRefEl.getQName(element);
+                    message.setElementName(qname);
+                } catch (WSDLException e) {
+                    getErrorReporter().reportError( 
+                            new ErrorLocatorImpl(),  //TODO line&col nos.
+                            "WSDL505",
+                            new Object[] {element, msgRefEl.getQName()},
+                            ErrorReporter.SEVERITY_ERROR);
+                }
+            }
+        }
+        else
+        {
+            //Per mapping defined in WSDL 2.0 Part 2 spec section 2.5.3,
+            //if element attribute not present, message content model is #other
+            message.setMessageContentModel(Constants.NMTOKEN_OTHER);
+        }
+
+        parseExtensionAttributes(msgRefEl, 
InterfaceMessageReferenceElement.class, message, desc);
+
+        XMLElement tempEl = msgRefEl.getFirstChildElement();
+        QName tempElQN = null;
+
+        while (tempEl != null)
+        {
+            tempElQN = tempEl.getQName();
+
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+            {
+                parseDocumentation(tempEl, desc, message);
+            }
+            else if (Constants.Q_ELEM_FEATURE.equals(tempElQN))
+            {
+                parseFeature(tempEl, desc, message);
+            }
+            else if (Constants.Q_ELEM_PROPERTY.equals(tempElQN))
+            {
+                parseProperty(tempEl, desc, message);
+            }
+            else
+            {
+                message.addExtensionElement(
+                        
parseExtensionElement(InterfaceMessageReferenceElement.class, message, tempEl, 
desc) );
+            }
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return message;
+    }
+
+    private BindingElement parseBinding(
+            XMLElement bindEl,
+            DescriptionElement desc)
+            throws WSDLException {
+
+        BindingElement binding = desc.addBindingElement();
+
+        String name = bindEl.getAttribute(Constants.ATTR_NAME);
+        if(name != null)
+        {
+            binding.setName(new NCName(name));
+        }
+
+        QName intfaceQN = null;
+        String intface = bindEl.getAttribute(Constants.ATTR_INTERFACE);
+        if(intface != null)
+        {
+            try {
+                intfaceQN = bindEl.getQName(intface);
+                binding.setInterfaceName(intfaceQN);
+            } catch (WSDLException e) {
+                getErrorReporter().reportError( 
+                        new ErrorLocatorImpl(),  //TODO line&col nos.
+                        "WSDL505",
+                        new Object[] {intface, bindEl.getQName()},
+                        ErrorReporter.SEVERITY_ERROR);
+            }
+        }
+
+        String type = bindEl.getAttribute(Constants.ATTR_TYPE);
+        if(type != null) {
+            binding.setType(getURI(type));
+        }
+
+        parseExtensionAttributes(bindEl, BindingElement.class, binding, desc);
+
+        /* Parse the child elements of <binding>. 
+         * As per WSDL 2.0 spec, they must be in the following order if 
present:
+         * <documentation>
+         * <fault> <operation> <feature> <property> or extension elements in 
any order
+         * TODO validate that the elements are in correct order
+         */ 
+
+        XMLElement tempEl = bindEl.getFirstChildElement();
+        QName tempElQN = null;
+
+        while (tempEl != null)
+        {
+            tempElQN = tempEl.getQName();
+
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+            {
+                parseDocumentation(tempEl, desc, binding);
+            }
+            else if (Constants.Q_ELEM_FAULT.equals(tempElQN))
+            {
+                parseBindingFault(tempEl, desc, binding);
+            }
+            else if (Constants.Q_ELEM_OPERATION.equals(tempElQN))
+            {
+                parseBindingOperation(tempEl, desc, binding);
+            }
+            else if (Constants.Q_ELEM_FEATURE.equals(tempElQN))
+            {
+                parseFeature(tempEl, desc, binding);
+            }
+            else if (Constants.Q_ELEM_PROPERTY.equals(tempElQN))
+            {
+                parseProperty(tempEl, desc, binding);
+            }
+            else
+            {
+                binding.addExtensionElement(
+                        parseExtensionElement(BindingElement.class, binding, 
tempEl, desc) );
+            }
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return binding;
+    }
+
+    private BindingFaultElement parseBindingFault(XMLElement bindFaultEl,
+            DescriptionElement desc,
+            BindingElement parent)
+            throws WSDLException {
+
+        BindingFaultElement fault = parent.addBindingFaultElement();
+        fault.setParentElement(parent);
+
+        QName intFltQN = null;
+        String ref = bindFaultEl.getAttribute(Constants.ATTR_REF);
+        if(ref != null)
+        {
+            try {
+                intFltQN = bindFaultEl.getQName(ref);
+                fault.setRef(intFltQN);
+            } catch (WSDLException e) {
+                getErrorReporter().reportError( 
+                        new ErrorLocatorImpl(),  //TODO line&col nos.
+                        "WSDL505",
+                        new Object[] {ref, bindFaultEl.getQName()},
+                        ErrorReporter.SEVERITY_ERROR);
+            }
+        }
+
+        parseExtensionAttributes(bindFaultEl, BindingFaultElement.class, 
fault, desc);
+
+        /* Parse the child elements of binding <fault>. 
+         * As per WSDL 2.0 spec, they must be in the following order if 
present:
+         * <documentation> 
+         * <feature> <property> or extension elements in any order
+         * TODO validate that the elements are in correct order
+         */ 
+
+        XMLElement tempEl = bindFaultEl.getFirstChildElement();
+        QName tempElQN = null;
+
+        while (tempEl != null)
+        {
+            tempElQN = tempEl.getQName();
+
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+            {
+                parseDocumentation(tempEl, desc, fault);
+            }
+            else if (Constants.Q_ELEM_FEATURE.equals(tempElQN))
+            {
+                parseFeature(tempEl, desc, fault);
+            }
+            else if (Constants.Q_ELEM_PROPERTY.equals(tempElQN))
+            {
+                parseProperty(tempEl, desc, fault);
+            }
+            else
+            {
+                fault.addExtensionElement(
+                        parseExtensionElement(BindingFaultElement.class, 
fault, tempEl, desc) );
+            }
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return fault;
+    }
+
+    private BindingOperationElement parseBindingOperation(
+            XMLElement bindOpEl,
+            DescriptionElement desc,
+            BindingElement parent)
+            throws WSDLException {
+
+        BindingOperationElement oper = parent.addBindingOperationElement();
+        oper.setParentElement(parent);
+
+        QName refQN = null;
+        String ref = bindOpEl.getAttribute(Constants.ATTR_REF);
+        if(ref != null)
+        {
+            try {
+                refQN = bindOpEl.getQName(ref);
+                oper.setRef(refQN);
+            } catch (WSDLException e) {
+                getErrorReporter().reportError( 
+                        new ErrorLocatorImpl(),  //TODO line&col nos.
+                        "WSDL505",
+                        new Object[] {ref, bindOpEl.getQName()},
+                        ErrorReporter.SEVERITY_ERROR);
+            }
+        }
+
+        parseExtensionAttributes(bindOpEl, BindingOperationElement.class, 
oper, desc);
+
+        /* Parse the child elements of binding <operation>. 
+         * As per WSDL 2.0 spec, they must be in the following order if 
present:
+         * <documentation> 
+         * <input> <output> <infault> <outfault> <feature> <property> or 
extension elements in any order
+         * TODO validate that the elements are in correct order
+         */ 
+
+        XMLElement tempEl = bindOpEl.getFirstChildElement();
+        QName tempElQN = null;
+
+        while (tempEl != null)
+        {
+            tempElQN = tempEl.getQName();
+
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+            {
+                parseDocumentation(tempEl, desc, oper);
+            }
+            else if (Constants.Q_ELEM_FEATURE.equals(tempElQN))
+            {
+                parseFeature(tempEl, desc, oper);
+            }
+            else if (Constants.Q_ELEM_PROPERTY.equals(tempElQN))
+            {
+                parseProperty(tempEl, desc, oper);
+            }
+            else if (Constants.Q_ELEM_INPUT.equals(tempElQN))
+            {
+                parseBindingMessageReference(tempEl, desc, oper);
+            }
+            else if (Constants.Q_ELEM_OUTPUT.equals(tempElQN))
+            {
+                parseBindingMessageReference(tempEl, desc, oper);
+            }
+            else if (Constants.Q_ELEM_INFAULT.equals(tempElQN))
+            {
+                parseBindingFaultReference(tempEl, desc, oper);
+            }
+            else if (Constants.Q_ELEM_OUTFAULT.equals(tempElQN))
+            {
+                parseBindingFaultReference(tempEl, desc, oper);
+            }
+            else
+            {
+                oper.addExtensionElement(
+                        parseExtensionElement(BindingOperationElement.class, 
oper, tempEl, desc) );
+            }
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return oper;
+    }
+
+    private BindingFaultReferenceElement parseBindingFaultReference(
+            XMLElement faultRefEl,
+            DescriptionElement desc,
+            BindingOperationElement parent)
+            throws WSDLException {
+
+        BindingFaultReferenceElement faultRef = 
parent.addBindingFaultReferenceElement();
+        faultRef.setParentElement(parent);
+
+        QName refQN = null;
+        String ref = faultRefEl.getAttribute(Constants.ATTR_REF);
+        if(ref != null)
+        {
+            try {
+                refQN = faultRefEl.getQName(ref);
+                faultRef.setRef(refQN);
+            } catch (WSDLException e) {
+                getErrorReporter().reportError( 
+                        new ErrorLocatorImpl(),  //TODO line&col nos.
+                        "WSDL505",
+                        new Object[] {ref, faultRefEl.getQName()},
+                        ErrorReporter.SEVERITY_ERROR);
+            }
+        }
+
+        String msgLabel = 
faultRefEl.getAttribute(Constants.ATTR_MESSAGE_LABEL);
+        if(msgLabel != null)
+        {
+            faultRef.setMessageLabel(new NCName(msgLabel));
+        }
+
+        parseExtensionAttributes(faultRefEl, 
BindingFaultReferenceElement.class, faultRef, desc);
+
+        /* Parse the child elements of binding operation <infault> or 
<outfault>. 
+         * As per WSDL 2.0 spec, they must be in the following order if 
present:
+         * <documentation> 
+         * <feature> <property> or extension elements in any order
+         * TODO validate that the elements are in correct order
+         */ 
+
+        XMLElement tempEl = faultRefEl.getFirstChildElement();
+        QName tempElQN = null;
+
+        while (tempEl != null)
+        {
+            tempElQN = tempEl.getQName();
+
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+            {
+                parseDocumentation(tempEl, desc, faultRef);
+            }
+            else if (Constants.Q_ELEM_FEATURE.equals(tempElQN))
+            {
+                parseFeature(tempEl, desc, faultRef);
+            }
+            else if (Constants.Q_ELEM_PROPERTY.equals(tempElQN))
+            {
+                parseProperty(tempEl, desc, faultRef);
+            }
+            else
+            {
+                faultRef.addExtensionElement(
+                        
parseExtensionElement(BindingFaultReferenceElement.class, faultRef, tempEl, 
desc) );
+            }
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return faultRef;
+    }
+
+    private BindingMessageReferenceElement parseBindingMessageReference(
+            XMLElement msgRefEl,
+            DescriptionElement desc,
+            BindingOperationElement parent)
+            throws WSDLException {
+
+        BindingMessageReferenceElement message = 
parent.addBindingMessageReferenceElement();
+        message.setParentElement(parent);
+
+        if(Constants.ELEM_INPUT.equals(msgRefEl.getLocalName())) {
+            message.setDirection(Direction.IN);
+        } 
+        else if(Constants.ELEM_OUTPUT.equals(msgRefEl.getLocalName())) {
+            message.setDirection(Direction.OUT);
+        }
+
+        String msgLabel = msgRefEl.getAttribute(Constants.ATTR_MESSAGE_LABEL);
+        if(msgLabel != null) 
+        {
+            message.setMessageLabel(new NCName(msgLabel));
+        }
+        else
+        {
+            //TODO this is a temp fix, correct action to use MEP to determine 
default
+            if(message.getDirection().equals(Direction.IN))
+            {
+                message.setMessageLabel(MessageLabel.IN);
+            }
+            else
+            {
+                message.setMessageLabel(MessageLabel.OUT);
+            }
+        }
+
+        parseExtensionAttributes(msgRefEl, 
BindingMessageReferenceElement.class, message, desc);
+
+        /* Parse the child elements of binding operation <input> or <output>. 
+         * As per WSDL 2.0 spec, they must be in the following order if 
present:
+         * <documentation> 
+         * <feature> <property> or extension elements in any order
+         * TODO validate that the elements are in correct order
+         */ 
+
+        XMLElement tempEl = msgRefEl.getFirstChildElement();
+        QName tempElQN = null;
+
+        while (tempEl != null)
+        {
+            tempElQN = tempEl.getQName();
+
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+            {
+                parseDocumentation(tempEl, desc, message);
+            }
+            else if (Constants.Q_ELEM_FEATURE.equals(tempElQN))
+            {
+                parseFeature(tempEl, desc, message);
+            }
+            else if (Constants.Q_ELEM_PROPERTY.equals(tempElQN))
+            {
+                parseProperty(tempEl, desc, message);
+            }
+            else
+            {
+                message.addExtensionElement(
+                        
parseExtensionElement(BindingMessageReferenceElement.class, message, tempEl, 
desc) );
+            }
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return message;
+    }
+
+    private ServiceElement parseService(
+            XMLElement serviceEl,
+            DescriptionElement desc)
+            throws WSDLException {
+
+        ServiceElement service = desc.addServiceElement();
+
+        String name = serviceEl.getAttribute(Constants.ATTR_NAME);
+        if(name != null)
+        {
+            service.setName(new NCName(name));
+        }
+
+        QName intfaceQN = null;
+        String intface = serviceEl.getAttribute(Constants.ATTR_INTERFACE);
+        if(intface != null)
+        {
+            try {
+                intfaceQN = serviceEl.getQName(intface);
+                service.setInterfaceName(intfaceQN);
+            } catch (WSDLException e) {
+                getErrorReporter().reportError( 
+                        new ErrorLocatorImpl(),  //TODO line&col nos.
+                        "WSDL505",
+                        new Object[] {intface, serviceEl.getQName()},
+                        ErrorReporter.SEVERITY_ERROR);
+            }
+        }
+
+               parseExtensionAttributes(serviceEl, ServiceElement.class, 
service, desc);
+
+               /* Parse the child elements of <service>. 
+                * As per WSDL 2.0 spec, they must be in the following order if 
present:
+                * <documentation> 
+                * <endpoint>
+                * <feature> <property> or extension elements in any order
+                * TODO validate that the elements are in correct order
+                */ 
+
+               XMLElement tempEl = serviceEl.getFirstChildElement();
+               QName tempElQN = null;
+
+               while (tempEl != null)
+               {
+                       tempElQN = tempEl.getQName();
+
+                       if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+                       {
+                               parseDocumentation(tempEl, desc, service);
+                       }
+                       else if (Constants.Q_ELEM_ENDPOINT.equals(tempElQN))
+                       {
+                               parseEndpoint(tempEl, desc, service);
+                       }
+                       else if (Constants.Q_ELEM_FEATURE.equals(tempElQN))
+                       {
+                               parseFeature(tempEl, desc, service);
+                       }
+                       else if (Constants.Q_ELEM_PROPERTY.equals(tempElQN))
+                       {
+                               parseProperty(tempEl, desc, service);
+                       }
+                       else
+                       {
+                               service.addExtensionElement(
+                                               
parseExtensionElement(ServiceElement.class, service, tempEl, desc) );
+                       }
+
+                       tempEl = tempEl.getNextSiblingElement();
+               }
+
+               return service;
+       }
+            
+    private EndpointElement parseEndpoint(
+            XMLElement endpointEl,
+            DescriptionElement desc,
+            ServiceElement parent)
+            throws WSDLException {
+
+        EndpointElement endpoint = parent.addEndpointElement();
+        endpoint.setParentElement(parent);
+
+        String name = endpointEl.getAttribute(Constants.ATTR_NAME);
+        if(name != null)
+        {
+            endpoint.setName(new NCName(name));
+        }
+
+        QName bindingQN = null;
+        String binding = endpointEl.getAttribute(Constants.ATTR_BINDING);
+        if(binding != null)
+        {
+            try {
+                bindingQN = endpointEl.getQName(binding);
+                endpoint.setBindingName(bindingQN);
+            } catch (WSDLException e) {
+                getErrorReporter().reportError( 
+                        new ErrorLocatorImpl(),  //TODO line&col nos.
+                        "WSDL505",
+                        new Object[] {binding, endpointEl.getQName()},
+                        ErrorReporter.SEVERITY_ERROR);
+            }
+        }
+
+        String address = endpointEl.getAttribute(Constants.ATTR_ADDRESS);
+
+        if(address != null)
+        {
+            endpoint.setAddress(getURI(address));
+        }
+
+        parseExtensionAttributes(endpointEl, EndpointElement.class, endpoint, 
desc);
+
+        /* Parse the child elements of <endpoint>. 
+         * As per WSDL 2.0 spec, they must be in the following order if 
present:
+         * <documentation> 
+         * <feature> <property> or extension elements in any order
+         * TODO validate that the elements are in correct order
+         */ 
+
+        XMLElement tempEl = endpointEl.getFirstChildElement();
+        QName tempElQN = null;
+
+        while (tempEl != null)
+        {
+            tempElQN = tempEl.getQName();
+
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
+            {
+                parseDocumentation(tempEl, desc, endpoint);
+            }
+            else if (Constants.Q_ELEM_FEATURE.equals(tempElQN))
+            {
+                parseFeature(tempEl, desc, endpoint);
+            }
+            else if (Constants.Q_ELEM_PROPERTY.equals(tempElQN))
+            {
+                parseProperty(tempEl, desc, endpoint);
+            }
+            else
+            {
+                endpoint.addExtensionElement(
+                        parseExtensionElement(ServiceElement.class, endpoint, 
tempEl, desc) );
+            }
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return endpoint;
+    }
+
+    private FeatureElement parseFeature(
+            XMLElement featEl,
+            DescriptionElement desc, ConfigurableElement parent)
+            throws WSDLException {
+
+        FeatureElement feature = parent.addFeatureElement();
+        feature.setParentElement(parent);
+
+        String ref = featEl.getAttribute(Constants.ATTR_REF);
+        if(ref != null)
+        {
+            feature.setRef(getURI(ref));
+        }
+
+        String req = featEl.getAttribute(Constants.ATTR_REQUIRED);
+        feature.setRequired(Constants.VALUE_TRUE.equals(req) ? true : false);
+        //TODO t.b.c. what if attr value is not 'true' or 'false'? (eg, 
missing, mispelt or not lower case.
+
+        parseExtensionAttributes(featEl, FeatureElement.class, feature, desc);
+
+        /* Parse the child elements of the <feature> element. 
+         * As per WSDL 2.0 spec, they must be in the following order if 
present:
+         * <documentation>
+         * extension elements.
+         * 
+         * TODO validate that the elements are in correct order
+         */ 
+
+        XMLElement tempEl = featEl.getFirstChildElement();
+
+        while (tempEl != null)
+        {
+            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempEl.getQName()))
+            {
+                parseDocumentation(tempEl, desc, feature);
+            }
+            else
+            {
+                feature.addExtensionElement(
+                        parseExtensionElement(FeatureElement.class, feature, 
tempEl, desc) );
+            }
+
+            tempEl = tempEl.getNextSiblingElement();
+        }
+
+        return feature;
+    }
+
+    protected abstract PropertyElement parseProperty(
+            XMLElement propEl, 
+            DescriptionElement desc,
+            ConfigurableElement parent)
+            throws WSDLException;
+
+
+    /* --- */
+
+    protected ExtensionElement parseExtensionElement(
+            Class parentType,
+            WSDLElement parent,
+            XMLElement el,
+            DescriptionElement desc)
+            throws WSDLException {
+
+        QName elementType = el.getQName();
+        String namespaceURI = (el.getNamespaceURI()).toString();
+
+        try
+        {
+            if (namespaceURI == null || 
namespaceURI.equals(Constants.NS_URI_WSDL20))
+            {
+                getErrorReporter().reportError(
+                        new ErrorLocatorImpl(),  //TODO line&col nos.
+                        "WSDL520",
+                        new Object[] {elementType, parentType.getName()},
+                        ErrorReporter.SEVERITY_ERROR);
+                return null;
+            }
+
+            ExtensionRegistry extReg = desc.getExtensionRegistry();
+
+            if (extReg == null)
+            {
+                getErrorReporter().reportError(
+                        new ErrorLocatorImpl(),  //TODO line&col nos.
+                        "WSDL514",
+                        new Object[] {elementType, parentType.getName()},
+                        ErrorReporter.SEVERITY_ERROR);
+                return null;
+            }
+
+            ExtensionDeserializer extDS = extReg.queryDeserializer(parentType,
+                    elementType);
+
+            return extDS.unmarshall(parentType, parent, elementType, el, desc, 
extReg);
+        }
+        catch (WSDLException e)
+        {
+            if (e.getLocation() == null)
+            {
+                //TODO fix this after refactoring into BaseWSDLReader
+                //e.setLocation(XPathUtils.getXPathExprFromNode(el));
+            }
+            throw e;
+        }
+    }
+
+    protected abstract void parseExtensionAttributes(
+            XMLElement extEl, 
+            Class wsdlClass, 
+            WSDLElement wsdlObj,
+            DescriptionElement desc)
+            throws WSDLException;
+
+
+
+    protected abstract void parseNamespaceDeclarations(
+            XMLElement xmlElem, 
+            WSDLElement wsdlElem) 
+            throws WSDLException;
+
+    /* Parse the schema for schema to include the built in schema types in the 
Woden model.
+     * TODO: As there are a finite number of built in schema types it may be 
better to create
+     * constants rather than reading the schema for schema on the creation of 
every model. 
+     * Also, this method currently requires that the schema elements exist in 
the types element.
+     * This may not be the best idea as it may imply that this schema contains 
an actual import
+     * statement in a WSDL 2.0 document. This method also does not work for 
when building the
+     * model programmatically.
+     * This method should be reevaluated at a later point.
+     */
+    protected void parseSchemaForXMLSchema(DescriptionElement desc) {
+        //This method is subject to reevaluation and a different approach,
+        //so the default implementation is empty.
+        //Subclasses can override this to do something useful.
+    }
+
+    /* ************************************************************
+     *  Helper methods
+     * ************************************************************/
+
+    /**
+     * Returns an XMLElement object representing the specified element
+     * object. The element object argument must be compatible with the 
+     * concrete reader implementation. If so, this method returns an XMLElement
+     * object that is type-compatible with the reader implementatation (e.g. a
+     * DOMXMLElement for DOMWSDLReader).
+     * 
+     * @throws IllegalArgumentException if elem is not a type recognized by 
the 
+     * WSDLReader implementation.
+     */
+    abstract protected XMLElement createXMLElement(Object elem) throws 
IllegalArgumentException;
+
+    /*
+     * Convert a string of type xs:anyURI to a java.net.URI.
+     * An empty string argument will return an empty string URI.
+     * A null argument will return a null.
+     */
+    protected URI getURI(String anyURI) throws WSDLException {
+        URI uri = null;
+        if(anyURI != null)
+        {
+            try {
+                uri = new URI(anyURI);
+            } catch (URISyntaxException e) {
+                getErrorReporter().reportError(
+                        new ErrorLocatorImpl(),  //TODO line&col nos.
+                        "WSDL506", 
+                        new Object[] {anyURI}, 
+                        ErrorReporter.SEVERITY_ERROR, 
+                        e);
+            }
+        }
+        return uri;
+    }
+
+    /*
+     * Retrieve a WSDL document by resolving the location URI specified 
+     * on a WSDL &lt;import&gt; or &lt;include&gt; element.
+     */
+    protected abstract DescriptionElement getWSDLFromLocation(
+            String locationURI,
+            DescriptionElement desc,
+            Map wsdlModules)
+            throws WSDLException;
+
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to