Author: richard.opalka(a)jboss.com
Date: 2010-12-13 07:43:24 -0500 (Mon, 13 Dec 2010)
New Revision: 13466
Modified:
stack/native/branches/jbossws-native-3.4.1/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java
Log:
[JBWS-3139] workaround wsdl4j 1.6.2 IPv6 issue
Modified:
stack/native/branches/jbossws-native-3.4.1/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java
===================================================================
---
stack/native/branches/jbossws-native-3.4.1/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java 2010-12-13
12:39:30 UTC (rev 13465)
+++
stack/native/branches/jbossws-native-3.4.1/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java 2010-12-13
12:43:24 UTC (rev 13466)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
+import java.net.URI;
import java.net.URL;
import javax.wsdl.xml.WSDLLocator;
@@ -97,7 +98,26 @@
// An external URL
if (resource.startsWith("http://") ||
resource.startsWith("https://"))
{
- wsdlImport = resource;
+ // [JBWS-3139] there's a bug in wsdl4j 1.6.2 where imported schemas are
containing invalid IPv6 host name values :(
+ // The URL value of root WSDL is not malformed, so we're reusing it for
schemas URL construction.
+ if (resource.indexOf(parentURL.getFile()) != -1)
+ {
+ URI uri = null;
+ try {
+ uri = new URI(resource);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalArgumentException("Cannot resolve imported resource:
" + resource);
+ }
+ final String path = uri.getPath();
+ final String query = uri.getQuery() != null ? "?" + uri.getQuery()
: "";
+ wsdlImport = parentURL.getProtocol() + "://" + parentURL.getHost()
+ ":" + parentURL.getPort() + path + query;
+ }
+ else
+ {
+ wsdlImport = resource;
+ }
}
// Absolute path
Show replies by date