Author: alessio.soldano(a)jboss.com
Date: 2011-04-26 08:12:42 -0400 (Tue, 26 Apr 2011)
New Revision: 14194
Modified:
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java
Log:
Fixing address rewrite regressions and updating the soap transport factory integration
point
Modified:
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
---
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2011-04-25
18:40:06 UTC (rev 14193)
+++
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2011-04-26
12:12:42 UTC (rev 14194)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -36,17 +36,13 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusException;
-//import org.apache.cxf.BusFactory;
+import org.apache.cxf.frontend.WSDLGetInterceptor;
import org.apache.cxf.service.model.EndpointInfo;
-//import org.apache.cxf.transport.Destination;
import org.apache.cxf.transport.DestinationFactory;
import org.apache.cxf.transport.DestinationFactoryManager;
import org.apache.cxf.transport.http.AbstractHTTPDestination;
import org.apache.cxf.transport.http.DestinationRegistry;
import org.apache.cxf.transport.http.HTTPTransportFactory;
-//import org.apache.cxf.transport.http.HttpDestinationFactory;
-//import org.apache.cxf.transport.servlet.ServletController;
-//import org.apache.cxf.transport.servlet.ServletDestination;
import org.apache.cxf.transports.http.QueryHandler;
import org.apache.cxf.transports.http.QueryHandlerRegistry;
import org.jboss.util.NotImplementedException;
@@ -78,12 +74,6 @@
public void handleHttpRequest(Endpoint ep, HttpServletRequest req, HttpServletResponse
res, ServletContext context) throws ServletException, IOException
{
-// ServletControllerExt controller =
(ServletControllerExt)context.getAttribute(ServletController.class.getName());
-// if (controller == null)
-// throw new IllegalStateException("Cannot obtain servlet
controller");
-//
-// controller.invoke(req, res, ep);
-
Bus bus = ep.getService().getDeployment().getAttachment(BusHolder.class).getBus();
AbstractHTTPDestination dest = findDestination(req, bus);
@@ -207,10 +197,8 @@
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);
- }
+ endpointInfo.setProperty(WSDLGetInterceptor.AUTO_REWRITE_ADDRESS,
+
ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost()));
for (QueryHandler queryHandler :
bus.getExtension(QueryHandlerRegistry.class).getHandlers())
{
Modified:
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java
===================================================================
---
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java 2011-04-25
18:40:06 UTC (rev 14193)
+++
stack/cxf/branches/cxf24/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java 2011-04-26
12:12:42 UTC (rev 14194)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -24,9 +24,8 @@
import java.util.Iterator;
import java.util.List;
-import javax.wsdl.Port;
-
import org.apache.cxf.binding.soap.SoapTransportFactory;
+import org.apache.cxf.binding.soap.jms.interceptor.SoapJMSConstants;
import org.apache.cxf.binding.soap.model.SoapBindingInfo;
import org.apache.cxf.service.model.BindingInfo;
import org.apache.cxf.service.model.EndpointInfo;
@@ -50,22 +49,22 @@
public class SoapTransportFactoryExt extends SoapTransportFactory
{
private ServerConfig serverConfig;
-
- @SuppressWarnings("unchecked")
- public EndpointInfo createEndpointInfo(ServiceInfo serviceInfo, BindingInfo b, Port
port)
+
+ @Override
+ public EndpointInfo createEndpointInfo(ServiceInfo serviceInfo, BindingInfo b,
List<?> ees)
{
String transportURI = "http://schemas.xmlsoap.org/wsdl/soap/";
if (b instanceof SoapBindingInfo)
{
- SoapBindingInfo sbi = (SoapBindingInfo)b;
+ SoapBindingInfo sbi = (SoapBindingInfo) b;
transportURI = sbi.getTransportURI();
}
ServerConfig config = getServerConfig();
EndpointInfo info = new AddressRewritingEndpointInfo(serviceInfo, transportURI,
config);
- if (port != null)
+
+ if (ees != null)
{
- List ees = port.getExtensibilityElements();
- for (Iterator itr = ees.iterator(); itr.hasNext();)
+ for (@SuppressWarnings("rawtypes")Iterator itr = ees.iterator();
itr.hasNext();)
{
Object extensor = itr.next();
@@ -75,6 +74,10 @@
info.addExtensor(sa);
info.setAddress(sa.getLocationURI());
+ if (isJMSSpecAddress(sa.getLocationURI()))
+ {
+
info.setTransportId(SoapJMSConstants.SOAP_JMS_SPECIFICIATION_TRANSPORTID);
+ }
}
else
{
@@ -82,9 +85,15 @@
}
}
}
+
return info;
}
-
+
+ private boolean isJMSSpecAddress(String address)
+ {
+ return address != null && address.startsWith("jms:") &&
!"jms://".equals(address);
+ }
+
private ServerConfig getServerConfig()
{
if (serverConfig == null)
Show replies by thread