Author: kurtstam
Date: 2011-11-15 10:01:20 -0500 (Tue, 15 Nov 2011)
New Revision: 1475
Modified:
branches/RiftSaw-2.3.x/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/JBossURLLocalizer.java
Log:
RIFTSAW-462, Avoid rewriting the URL with a double slash
Modified:
branches/RiftSaw-2.3.x/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/JBossURLLocalizer.java
===================================================================
---
branches/RiftSaw-2.3.x/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/JBossURLLocalizer.java 2011-11-14
18:31:59 UTC (rev 1474)
+++
branches/RiftSaw-2.3.x/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/JBossURLLocalizer.java 2011-11-15
15:01:20 UTC (rev 1475)
@@ -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