Author: jkaputin
Date: Tue Oct 17 13:06:15 2006
New Revision: 465023

URL: http://svn.apache.org/viewvc?view=rev&rev=465023
Log:
In the getNamespaceURI method, catch a 
URISyntaxException and rethrow it as a
WSDLException.

Modified:
    incubator/woden/branches/WODEN-44/src/org/apache/woden/XMLElement.java
    
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/BaseXMLElement.java
    
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/DOMXMLElement.java

Modified: incubator/woden/branches/WODEN-44/src/org/apache/woden/XMLElement.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-44/src/org/apache/woden/XMLElement.java?view=diff&rev=465023&r1=465022&r2=465023
==============================================================================
--- incubator/woden/branches/WODEN-44/src/org/apache/woden/XMLElement.java 
(original)
+++ incubator/woden/branches/WODEN-44/src/org/apache/woden/XMLElement.java Tue 
Oct 17 13:06:15 2006
@@ -76,7 +76,7 @@
      *
      * @return the namespace URI of the element
      */
-    public URI getNamespaceURI();
+    public URI getNamespaceURI() throws WSDLException;
 
     /**
      *

Modified: 
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/BaseXMLElement.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/BaseXMLElement.java?view=diff&rev=465023&r1=465022&r2=465023
==============================================================================
--- 
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/BaseXMLElement.java
 (original)
+++ 
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/BaseXMLElement.java
 Tue Oct 17 13:06:15 2006
@@ -73,7 +73,7 @@
      * (non-Javadoc)
      * @see org.apache.woden.XMLElement#getNamespaceURI()
      */
-    public final URI getNamespaceURI() {
+    public final URI getNamespaceURI() throws WSDLException {
        
        if(fSource != null) {
                return doGetNamespaceURI();
@@ -82,7 +82,7 @@
        }
     }
     
-    protected abstract URI doGetNamespaceURI();
+    protected abstract URI doGetNamespaceURI() throws WSDLException;
 
     /*
      * (non-Javadoc)

Modified: 
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/DOMXMLElement.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/DOMXMLElement.java?view=diff&rev=465023&r1=465022&r2=465023
==============================================================================
--- 
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/DOMXMLElement.java
 (original)
+++ 
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/DOMXMLElement.java
 Tue Oct 17 13:06:15 2006
@@ -17,6 +17,7 @@
 package org.apache.woden.internal;
 
 import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.List;
 import java.util.Vector;
 
@@ -87,11 +88,22 @@
        return getAttribute(el, attrName);
     }
 
-    protected URI doGetNamespaceURI() {
+    protected URI doGetNamespaceURI() throws WSDLException {
 
        Element el = (Element)fSource;
        String nsStr =  el.getNamespaceURI();
-       return URI.create(nsStr);
+       URI uri = null;
+       
+       try {
+               uri = new URI(nsStr);
+       } catch (URISyntaxException e) {
+               String msg = fErrorReporter.getFormattedMessage(
+                                                       "WSDL506", 
+                                                       new Object[] {nsStr});
+               throw new WSDLException(WSDLException.INVALID_WSDL, msg, e);
+       }
+       
+       return uri;
     }
 
     protected String doGetLocalName() {



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

Reply via email to