cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r886934 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
Date Thu, 03 Dec 2009 21:54:20 GMT
Author: dkulp
Date: Thu Dec  3 21:54:19 2009
New Revision: 886934

URL: http://svn.apache.org/viewvc?rev=886934&view=rev
Log:
Put in place a guard against problems of our resolvers not being able to
resolve a wsdl, but wsd4j can.

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java?rev=886934&r1=886933&r2=886934&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java Thu Dec  3
21:54:19 2009
@@ -219,21 +219,26 @@
                                                                                 catLocator,
                                                                                 bus);
         InputSource src = wsdlLocator.getBaseInputSource();
-        Document doc;
-        try {
-            doc = StaxUtils.read(StaxUtils.createXMLStreamReader(src), true);
-            if (src.getSystemId() != null) {
-                try {
-                    doc.setDocumentURI(new String(src.getSystemId()));
-                } catch (Exception e) {
-                    // ignore - probably not DOM level 3
+        Definition def = null;
+        if (src.getByteStream() != null || src.getCharacterStream() != null) {
+            Document doc;
+            try {
+                doc = StaxUtils.read(StaxUtils.createXMLStreamReader(src), true);
+                if (src.getSystemId() != null) {
+                    try {
+                        doc.setDocumentURI(new String(src.getSystemId()));
+                    } catch (Exception e) {
+                        //ignore - probably not DOM level 3
+                    }
                 }
+            } catch (Exception e) {
+                throw new WSDLException(WSDLException.PARSER_ERROR, e.getMessage(), e);
             }
-        } catch (Exception e) {
-            throw new WSDLException(WSDLException.PARSER_ERROR, e.getMessage(), e);
+            def = reader.readWSDL(wsdlLocator, doc.getDocumentElement());
+        } else {
+            def = reader.readWSDL(wsdlLocator);
         }
         
-        Definition def = reader.readWSDL(wsdlLocator, doc.getDocumentElement());
         synchronized (definitionsMap) {
             definitionsMap.put(url, def);
         }



Mime
View raw message