You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsif-dev@ws.apache.org by ow...@apache.org on 2003/04/17 16:21:17 UTC
cvs commit: xml-axis-wsif/java/src/org/apache/wsif/wsdl WSIFWSDLLocatorImpl.java
owenb 2003/04/17 07:21:17
Modified: java/src/org/apache/wsif/wsdl WSIFWSDLLocatorImpl.java
Log:
Fixed problem when reading imports from the file system when a classloader has been specified.
Revision Changes Path
1.19 +28 -1 xml-axis-wsif/java/src/org/apache/wsif/wsdl/WSIFWSDLLocatorImpl.java
Index: WSIFWSDLLocatorImpl.java
===================================================================
RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/wsdl/WSIFWSDLLocatorImpl.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- WSIFWSDLLocatorImpl.java 16 Apr 2003 10:08:47 -0000 1.18
+++ WSIFWSDLLocatorImpl.java 17 Apr 2003 14:21:16 -0000 1.19
@@ -153,6 +153,8 @@
}
if (url != null) {
documentBase = url.toString();
+ } else if (baseInputStream == null) {
+ documentBase = wsdlLocation;
}
} catch (Exception e) {
Trc.exception(e);
@@ -232,7 +234,32 @@
URL contextURL = (base != null) ? StringUtils.getURL(null, base) : null;
url = StringUtils.getURL(contextURL, relativeLocation);
importInputStream = StringUtils.getContentAsInputStream(url);
- }
+ }
+ if (importInputStream == null) {
+ if (!triedSU) {
+ try {
+ URL contextURL =
+ (base != null)
+ ? StringUtils.getURL(null, base)
+ : null;
+ URL url2 =
+ StringUtils.getURL(contextURL, relativeLocation);
+ importInputStream =
+ StringUtils.getContentAsInputStream(url2);
+ importBase =
+ (url2 == null) ? relativeLocation : url2.toString();
+ } catch (Exception e2) {
+ Trc.exception(e2);
+ // we can't find the import so set a temporary value for the import URI. This is
+ // necessary to avoid a NullPointerException in WSDLReaderImpl
+ importBase = "unknownImportURI";
+ }
+ } else {
+ // we can't find the import so set a temporary value for the import URI. This is
+ // necessary to avoid a NullPointerException in WSDLReaderImpl
+ importBase = "unknownImportURI";
+ }
+ }
importBase = (url == null) ? relativeLocation : url.toString();
} catch (Exception e) {
Trc.exception(e);