You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by tl...@apache.org on 2006/11/23 08:04:40 UTC
svn commit: r478495 - in /incubator/cxf/trunk:
common/common/src/main/java/org/apache/cxf/resource/
rt/core/src/main/java/org/apache/cxf/wsdl11/
Author: tli
Date: Wed Nov 22 23:04:40 2006
New Revision: 478495
URL: http://svn.apache.org/viewvc?view=rev&rev=478495
Log:
CXF-264 fix the URIResolver & WSDLManagerImpl to support resolve resources on remote server
Modified:
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ExtendedURIResolver.java
incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ExtendedURIResolver.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ExtendedURIResolver.java?view=diff&rev=478495&r1=478494&r2=478495
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ExtendedURIResolver.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/ExtendedURIResolver.java Wed Nov 22 23:04:40 2006
@@ -51,10 +51,9 @@
InputStream in = currentResolver.getInputStream();
resourceOpened.addElement(in);
InputSource source = new InputSource(in);
- source.setSystemId(curUri);
+ source.setSystemId(curUri);
return source;
}
-
} catch (IOException e) {
// move on...
}
Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java?view=diff&rev=478495&r1=478494&r2=478495
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java Wed Nov 22 23:04:40 2006
@@ -120,11 +120,16 @@
base = base.resolve(relative);
if (base.isAbsolute()) {
- baseFile = new File(base);
- if (baseFile.exists()) {
- is = base.toURL().openStream();
- uri = base;
- } else {
+ try {
+ baseFile = new File(base);
+ if (baseFile.exists()) {
+ is = base.toURL().openStream();
+ uri = base;
+ } else {
+ tryClasspath(base.toString().startsWith("file:")
+ ? base.toString().substring(5) : base.toString());
+ }
+ } catch (Throwable th) {
tryClasspath(base.toString().startsWith("file:")
? base.toString().substring(5) : base.toString());
}
Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java?view=diff&rev=478495&r1=478494&r2=478495
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java Wed Nov 22 23:04:40 2006
@@ -45,6 +45,7 @@
import org.apache.cxf.common.util.PropertiesLoaderUtils;
import org.apache.cxf.wsdl.JAXBExtensionHelper;
import org.apache.cxf.wsdl.WSDLManager;
+import org.apache.cxf.wsdl4jutils.WSDLLocatorImpl;
/**
* WSDLManagerImpl
@@ -160,7 +161,8 @@
WSDLReader reader = factory.newWSDLReader();
reader.setFeature("javax.wsdl.verbose", false);
reader.setExtensionRegistry(registry);
- Definition def = reader.readWSDL(url);
+ WSDLLocatorImpl wsdlLocator = new WSDLLocatorImpl(url);
+ Definition def = reader.readWSDL(wsdlLocator);
synchronized (definitionsMap) {
definitionsMap.put(url, def);
}