Author: asoldano
Date: 2014-05-19 08:41:41 -0400 (Mon, 19 May 2014)
New Revision: 18673
Modified:
stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/addressRewrite/SoapAddressRewriteHelper.java
Log:
Modified:
stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
---
stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2014-05-19
12:40:35 UTC (rev 18672)
+++
stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2014-05-19
12:41:41 UTC (rev 18673)
@@ -138,26 +138,6 @@
throw
Messages.MESSAGES.cannotObtainRegistry(DestinationRegistry.class.getName());
}
- //------ rls start
- // this substitution enables a AbstractHTTPDestination object to be found.
- ServerConfig serverConfig = getServerConfig();
- if(serverConfig.isModifySOAPAddress())
- {
- String altContextRoot = serverConfig.getWebServicePath();
- if ((altContextRoot != null && altContextRoot.length() > 0))
- {
- //final Service service = dep.getService();
- //service.getContextRoot();
- // TMP USAGE. NEED TO GET context-root from the service obj.
- String contextRoot = "/jaxws-jbws2150"; // rls test only
- String tmpContextRoot = (altContextRoot.startsWith("/")) ?
altContextRoot : "/" + altContextRoot;
- String tmpRequestURI = requestURI;
- requestURI = tmpRequestURI.replace(contextRoot, tmpContextRoot);
-
- }
- }
- //------ rls end
-
requestURI = pathPattern.matcher(requestURI).replaceAll("/");
//first try looking up the destination in the registry map
final AbstractHTTPDestination dest = destRegistry.getDestinationForPath(requestURI,
true);
Modified:
stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/addressRewrite/SoapAddressRewriteHelper.java
===================================================================
---
stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/addressRewrite/SoapAddressRewriteHelper.java 2014-05-19
12:40:35 UTC (rev 18672)
+++
stack/cxf/branches/rsearls/modules/server/src/main/java/org/jboss/wsf/stack/cxf/addressRewrite/SoapAddressRewriteHelper.java 2014-05-19
12:41:41 UTC (rev 18673)
@@ -56,7 +56,7 @@
final String origUriScheme = getUriScheme(wsdlAddress); //will be https if the
user wants a https address in the wsdl
final String newUriScheme = getUriScheme(epAddress); //will be https if the user
set confidential transport for the endpoint
final String uriScheme = (origUriScheme.equals(HTTPS) ||
newUriScheme.equals(HTTPS)) ? HTTPS : HTTP;
- return rewriteSoapAddress(serverConfig, wsdlAddress, epAddress, uriScheme);
+ return rewriteSoapAddress(serverConfig, wsdlAddress, epAddress, uriScheme,
serverConfig.getWebServicePath());
}
else
{
@@ -118,7 +118,7 @@
* @param uriScheme The uriScheme to use for rewrite
* @return The obtained address
*/
- private static String rewriteSoapAddress(ServerConfig serverConfig, String
origAddress, String newAddress, String uriScheme)
+ private static String rewriteSoapAddress(ServerConfig serverConfig, String
origAddress, String newAddress, String uriScheme, String additionalCcontext)
{
try
{
@@ -143,7 +143,19 @@
}
}
- String urlStr = uriScheme + "://" + host + port + path;
+ StringBuilder sb = new StringBuilder(uriScheme);
+ sb.append("://");
+ sb.append(host);
+ sb.append(port);
+ if (additionalCcontext != null) {
+ if (!additionalCcontext.startsWith("/")) {
+ sb.append("/");
+ }
+ sb.append(additionalCcontext);
+ }
+ sb.append(path);
+ final String urlStr = sb.toString();
+
ADDRESS_REWRITE_LOGGER.addressRewritten(origAddress, urlStr);
return urlStr;
}
Show replies by date