Index: /home/nrla/eclipse-IPv6/jbossws-native-2.0.1.SP2_CP07/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java =================================================================== --- /home/nrla/eclipse-IPv6/jbossws-native-2.0.1.SP2_CP07/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java (revision 11283) +++ /home/nrla/eclipse-IPv6/jbossws-native-2.0.1.SP2_CP07/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java (working copy) @@ -213,6 +213,8 @@ */ public static String getServiceEndpointAddress(String uriScheme, String servicePath) { + log.info("uriScheme=" + uriScheme + ", servicePath=" + servicePath) ; + if (servicePath == null || servicePath.length() == 0) throw new WSException("Service path cannot be null"); @@ -245,7 +247,9 @@ } } - String urlStr = uriScheme + "://" + host + port + servicePath; + // JBPAPP-2997 + // String urlStr = uriScheme + "://" + host + port + servicePath; + String urlStr = uriScheme + "://" + fixHostnameForURL(host) + port + servicePath; try { return new URL(urlStr).toExternalForm(); @@ -256,6 +260,16 @@ } } + private static String fixHostnameForURL(String host) { + if (host == null) + return host ; + + if (host.indexOf(":") != -1) + return "[" + host + "]" ; + else + return host ; + } + /** * Read the transport guarantee from web.xml */