Author: alessio.soldano(a)jboss.com
Date: 2009-07-28 12:16:08 -0400 (Tue, 28 Jul 2009)
New Revision: 10401
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
Log:
[JBWS-2227] Setting autoRewriteSoapAddress prop on EndpointInfo to enable soap:address
rewrite (requires new CXF version)
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2009-07-28
13:54:43 UTC (rev 10400)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2009-07-28
16:16:08 UTC (rev 10401)
@@ -39,8 +39,12 @@
import org.apache.cxf.transport.servlet.ServletTransportFactory;
import org.apache.cxf.transports.http.QueryHandler;
import org.apache.cxf.transports.http.QueryHandlerRegistry;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.management.EndpointMetrics;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
/**
* An extension to the CXF servlet controller
@@ -53,6 +57,7 @@
private ServletTransportFactory cxfTransport;
private ServletContext servletCtx;
private Bus bus;
+ private ServerConfig serverConfig;
public ServletControllerExt(ServletTransportFactory cxfTransport, ServletConfig
config, ServletContext servletCtx, Bus bus)
{
@@ -60,6 +65,8 @@
this.cxfTransport = cxfTransport;
this.servletCtx = servletCtx;
this.bus = bus;
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
}
/**
@@ -128,6 +135,10 @@
String ctxUri = req.getRequestURI();
String baseUri = req.getRequestURL().toString() + "?" +
req.getQueryString();
EndpointInfo endpointInfo = dest.getEndpointInfo();
+ if (ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost()))
+ {
+ endpointInfo.setProperty("autoRewriteSoapAddress", true);
+ }
for (QueryHandler queryHandler :
bus.getExtension(QueryHandlerRegistry.class).getHandlers())
{
Show replies by date