Author: kurtstam
Date: 2011-11-14 13:31:59 -0500 (Mon, 14 Nov 2011)
New Revision: 1474
Modified:
trunk/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/JBossURLLocalizer.java
Log:
RIFTSAW-462, Avoid rewriting the URL with a double slash
Modified: trunk/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/JBossURLLocalizer.java
===================================================================
---
trunk/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/JBossURLLocalizer.java 2011-11-07
11:38:09 UTC (rev 1473)
+++
trunk/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/JBossURLLocalizer.java 2011-11-14
18:31:59 UTC (rev 1474)
@@ -54,7 +54,9 @@
* @return
*/
public String rewriteToWSDLURL(URL url) {
- return getWebserviceBaseUrl() + url.getPath() + "?wsdl";
+ String path = url.getPath();
+ if (! path.startsWith("/")) path = "/" + path;
+ return getWebserviceBaseUrl() + path + "?wsdl";
}
/**
*
@@ -62,7 +64,9 @@
* @return
*/
public String rewrite(URL url) {
- return getWebserviceBaseUrl() + url.getPath();
+ String path = url.getPath();
+ if (! path.startsWith("/")) path = "/" + path;
+ return getWebserviceBaseUrl() + path;
}
/**
*
@@ -71,7 +75,7 @@
private String getWebserviceBaseUrl() {
String url = properties.getProperty(BPELEngineImpl.BPEL_WEBSERVICE_BASEURL);
if (url != null) {
- if (!url.endsWith("/")) url = url + "/";
+ if (url.endsWith("/")) url = url.substring(0,url.length()-1);
return url;
}
return getDefaultWebServiceBaseUrl();
@@ -88,7 +92,7 @@
theURL = new URL("https://" + webServiceHost + ":" +
secureWebServicePort);
}
String url = theURL.toExternalForm();
- if (!url.endsWith("/")) url = url + "/";
+ if (url.endsWith("/")) url = url.substring(0, url.length()-1);
return url;
} catch (MalformedURLException e) {
log.error("Error in constructing the webservice base url.", e);
Show replies by date