JBossWS SVN: r12201 - in stack/cxf/trunk: modules/client/src/main/resources/META-INF and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-11 04:04:50 -0400 (Tue, 11 May 2010)
New Revision: 12201
Modified:
stack/cxf/trunk/modules/client/src/main/resources/META-INF/extensions.xml
stack/cxf/trunk/modules/client/src/main/resources/META-INF/tools.service.validator.xml
stack/cxf/trunk/modules/client/src/main/resources/META-INF/wsdl.plugin.xml
stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt
stack/cxf/trunk/pom.xml
Log:
[JBWS-3018] Moving to Apache CXF 2.2.8
Modified: stack/cxf/trunk/modules/client/src/main/resources/META-INF/extensions.xml
===================================================================
--- stack/cxf/trunk/modules/client/src/main/resources/META-INF/extensions.xml 2010-05-11 06:03:22 UTC (rev 12200)
+++ stack/cxf/trunk/modules/client/src/main/resources/META-INF/extensions.xml 2010-05-11 08:04:50 UTC (rev 12201)
@@ -19,7 +19,7 @@
-->
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-<properties version="1.0">
+<properties>
<entry key="org.apache.cxf.binding.corba-1">javax.wsdl.Binding=org.apache.cxf.binding.corba.wsdl.BindingType</entry>
<entry key="org.apache.cxf.binding.corba-2">javax.wsdl.BindingOperation=org.apache.cxf.binding.corba.wsdl.OperationType</entry>
<entry key="org.apache.cxf.binding.corba-3">javax.wsdl.Definition=org.apache.cxf.binding.corba.wsdl.TypeMappingType</entry>
Modified: stack/cxf/trunk/modules/client/src/main/resources/META-INF/tools.service.validator.xml
===================================================================
--- stack/cxf/trunk/modules/client/src/main/resources/META-INF/tools.service.validator.xml 2010-05-11 06:03:22 UTC (rev 12200)
+++ stack/cxf/trunk/modules/client/src/main/resources/META-INF/tools.service.validator.xml 2010-05-11 08:04:50 UTC (rev 12201)
@@ -19,7 +19,7 @@
-->
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-<properties version="1.0">
+<properties>
<entry key="UniqueBodyValidator">org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.UniqueBodyValidator</entry>
<entry key="WrapperStyleNameCollisionValidator">org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameCollisionValidator</entry>
<entry key="XMLFormatValidator">org.apache.cxf.binding.xml.XMLFormatValidator</entry>
Modified: stack/cxf/trunk/modules/client/src/main/resources/META-INF/wsdl.plugin.xml
===================================================================
--- stack/cxf/trunk/modules/client/src/main/resources/META-INF/wsdl.plugin.xml 2010-05-11 06:03:22 UTC (rev 12200)
+++ stack/cxf/trunk/modules/client/src/main/resources/META-INF/wsdl.plugin.xml 2010-05-11 08:04:50 UTC (rev 12201)
@@ -19,7 +19,7 @@
-->
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-<properties version="1.0">
+<properties>
<entry key="soap-javax.wsdl.Port">org.apache.cxf.binding.soap.wsdl11.SoapAddressPlugin</entry>
<entry key="xml-javax.wsdl.Port">org.apache.cxf.binding.xml.wsdl11.HttpAddressPlugin</entry>
<entry key="xml-javax.wsdl.Binding">org.apache.cxf.binding.xml.wsdl11.XmlBindingPlugin</entry>
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt 2010-05-11 06:03:22 UTC (rev 12200)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt 2010-05-11 08:04:50 UTC (rev 12201)
@@ -23,9 +23,6 @@
# [CXF-2006] RespectBinding feature and not understood required extensibility elements
org/jboss/test/ws/jaxws/jbws2449/**
-# [CXF-2723] Allow configuration of JaxWsClientFactoryBean during port creation
-org/jboss/test/ws/jaxws/cxf/jaxbintros/**
-
# [EJBTHREE-1152] service-ref in ejb-jar.xml is ignored
org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefEJBTestCase.*
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2010-05-11 06:03:22 UTC (rev 12200)
+++ stack/cxf/trunk/pom.xml 2010-05-11 08:04:50 UTC (rev 12201)
@@ -56,7 +56,7 @@
<jbossws.jboss601.version>3.2.1.GA</jbossws.jboss601.version>
-->
<!-- END -->
- <cxf.version>2.2.7</cxf.version>
+ <cxf.version>2.2.8</cxf.version>
<cxf.stax.version>1.0.1</cxf.stax.version>
<cxf.asm.version>2.2.3</cxf.asm.version>
<fastinfoset.api.version>1.2.7</fastinfoset.api.version>
@@ -77,7 +77,7 @@
<velocity.version>1.5</velocity.version>
<xmlsec.version>1.4.3</xmlsec.version>
<wstx.version>3.2.9</wstx.version>
- <spring.version>2.5.5</spring.version>
+ <spring.version>2.5.6</spring.version>
</properties>
14 years, 7 months
JBossWS SVN: r12200 - in common/trunk/src: main/java/org/jboss/wsf/common/injection/finders and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2010-05-11 02:03:22 -0400 (Tue, 11 May 2010)
New Revision: 12200
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/ResourceLoaderAdapter.java
common/trunk/src/main/java/org/jboss/wsf/common/URLLoaderAdapter.java
common/trunk/src/main/java/org/jboss/wsf/common/injection/finders/ResourceFieldFinder.java
common/trunk/src/main/java/org/jboss/wsf/common/injection/finders/ResourceMethodFinder.java
common/trunk/src/test/java/org/jboss/test/ws/common/ResourceLoaderAdapterTestCase.java
common/trunk/src/test/java/org/jboss/test/ws/common/URLLoaderAdapterTestCase.java
Log:
[JBWS-3023]:Fixed the windows issues in common module
Modified: common/trunk/src/main/java/org/jboss/wsf/common/ResourceLoaderAdapter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/ResourceLoaderAdapter.java 2010-05-10 14:50:33 UTC (rev 12199)
+++ common/trunk/src/main/java/org/jboss/wsf/common/ResourceLoaderAdapter.java 2010-05-11 06:03:22 UTC (rev 12200)
@@ -140,8 +140,8 @@
try
{
//get the jar and open it
- String folder = jarRoot.substring(5,jarRoot.lastIndexOf(File.separator));
- String filename = jarRoot.substring(jarRoot.lastIndexOf(File.separator)+1);
+ String folder = jarRoot.substring(5,jarRoot.lastIndexOf("/"));
+ String filename = jarRoot.substring(jarRoot.lastIndexOf("/")+1);
final File jar = new File(folder, filename);
PrivilegedAction<JarFile> action = new PrivilegedAction<JarFile>()
Modified: common/trunk/src/main/java/org/jboss/wsf/common/URLLoaderAdapter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/URLLoaderAdapter.java 2010-05-10 14:50:33 UTC (rev 12199)
+++ common/trunk/src/main/java/org/jboss/wsf/common/URLLoaderAdapter.java 2010-05-11 06:03:22 UTC (rev 12200)
@@ -151,8 +151,8 @@
try
{
- String folder = jarRoot.substring(5,jarRoot.lastIndexOf(File.separator));
- String filename = jarRoot.substring(jarRoot.lastIndexOf(File.separator)+1);
+ String folder = jarRoot.substring(5,jarRoot.lastIndexOf("/"));
+ String filename = jarRoot.substring(jarRoot.lastIndexOf("/")+1);
final File jar = new File(folder, filename);
PrivilegedAction<JarFile> action = new PrivilegedAction<JarFile>()
Modified: common/trunk/src/main/java/org/jboss/wsf/common/injection/finders/ResourceFieldFinder.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/injection/finders/ResourceFieldFinder.java 2010-05-10 14:50:33 UTC (rev 12199)
+++ common/trunk/src/main/java/org/jboss/wsf/common/injection/finders/ResourceFieldFinder.java 2010-05-11 06:03:22 UTC (rev 12200)
@@ -37,7 +37,7 @@
* method declaration if necessary. The name of the resource, if not declared, is the
* name of the JavaBeans property as determined starting from the name of the setter
* method in question. The setter method must follow the standard JavaBeans
- * convention - name starts with a “set”, void return type and only one parameter.
+ * convention - name starts with a 'set', void return type and only one parameter.
* Additionally, the type of the parameter must be compatible with the type specified
* as a property of the Resource if present.
*
Modified: common/trunk/src/main/java/org/jboss/wsf/common/injection/finders/ResourceMethodFinder.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/injection/finders/ResourceMethodFinder.java 2010-05-10 14:50:33 UTC (rev 12199)
+++ common/trunk/src/main/java/org/jboss/wsf/common/injection/finders/ResourceMethodFinder.java 2010-05-11 06:03:22 UTC (rev 12200)
@@ -36,7 +36,7 @@
* method declaration if necessary. The name of the resource, if not declared, is the
* name of the JavaBeans property as determined starting from the name of the setter
* method in question. The setter method must follow the standard JavaBeans
- * convention - name starts with a “set”, void return type and only one parameter.
+ * convention - name starts with a 'set', void return type and only one parameter.
* Additionally, the type of the parameter must be compatible with the type specified
* as a property of the Resource if present.
*
Modified: common/trunk/src/test/java/org/jboss/test/ws/common/ResourceLoaderAdapterTestCase.java
===================================================================
--- common/trunk/src/test/java/org/jboss/test/ws/common/ResourceLoaderAdapterTestCase.java 2010-05-10 14:50:33 UTC (rev 12199)
+++ common/trunk/src/test/java/org/jboss/test/ws/common/ResourceLoaderAdapterTestCase.java 2010-05-11 06:03:22 UTC (rev 12200)
@@ -72,7 +72,7 @@
UnifiedVirtualFile common = ula.findChild("org/jboss/wsf/common/");
assertNotNull(common);
- assertTrue(common.toURL().toExternalForm().contains("target" + File.separator + "classes")); //check we got a URL to dir
+ assertTrue(common.toURL().toExternalForm().contains("target/classes")); //check we got a URL to dir
assertEquals("common/", common.getName());
List<UnifiedVirtualFile> children = common.getChildren();
assertNotNull(children);
Modified: common/trunk/src/test/java/org/jboss/test/ws/common/URLLoaderAdapterTestCase.java
===================================================================
--- common/trunk/src/test/java/org/jboss/test/ws/common/URLLoaderAdapterTestCase.java 2010-05-10 14:50:33 UTC (rev 12199)
+++ common/trunk/src/test/java/org/jboss/test/ws/common/URLLoaderAdapterTestCase.java 2010-05-11 06:03:22 UTC (rev 12200)
@@ -76,7 +76,7 @@
UnifiedVirtualFile common = ula.findChild("org/jboss/wsf/common/");
assertNotNull(common);
- assertTrue(common.toURL().toExternalForm().contains("target" + File.separator + "classes")); //check we got a URL to dir
+ assertTrue(common.toURL().toExternalForm().contains("target/classes")); //check we got a URL to dir
assertEquals("common/", common.getName());
List<UnifiedVirtualFile> children = common.getChildren();
assertNotNull(children);
14 years, 7 months
JBossWS SVN: r12199 - framework/trunk/testsuite/test/resources/jaxws/smoke/tools/wsdl.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-10 10:50:33 -0400 (Mon, 10 May 2010)
New Revision: 12199
Modified:
framework/trunk/testsuite/test/resources/jaxws/smoke/tools/wsdl/async-binding.xml
Log:
[JBWS-3018] Fix invalid binding customization
Modified: framework/trunk/testsuite/test/resources/jaxws/smoke/tools/wsdl/async-binding.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/smoke/tools/wsdl/async-binding.xml 2010-05-10 10:05:11 UTC (rev 12198)
+++ framework/trunk/testsuite/test/resources/jaxws/smoke/tools/wsdl/async-binding.xml 2010-05-10 14:50:33 UTC (rev 12199)
@@ -3,7 +3,6 @@
wsdlLocation="TestService.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<package name="org.jboss.test.ws.tools.testBindingFiles"/>
- <enableWrapperStyle>true</enableWrapperStyle>
<enableAsyncMapping>true</enableAsyncMapping>
</bindings>
14 years, 7 months
JBossWS SVN: r12198 - stack/cxf/branches/jbossws-cxf-3.1.2/modules/client.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2010-05-10 06:05:11 -0400 (Mon, 10 May 2010)
New Revision: 12198
Modified:
stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/pom.xml
Log:
[JBAPP-4242]:updated the classpath entries in client menifest
Modified: stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/pom.xml
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/pom.xml 2010-05-07 17:19:51 UTC (rev 12197)
+++ stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/pom.xml 2010-05-10 10:05:11 UTC (rev 12198)
@@ -213,7 +213,7 @@
<customClasspathLayout>$${artifact.artifactId}.$${artifact.extension}</customClasspathLayout>
</manifest>
<manifestEntries>
- <Class-Path>jbossws-framework.jar jaxws-api.jar stax-api.jar wstx.jar</Class-Path>
+ <Class-Path>jbossws-framework.jar jaxws-api.jar jboss-logging.jar jboss-logging-spi.jar jboss-logging-log4j.jar jcl-over-slf4j.jar slf4j-api.jar slf4j-jboss-logging.jar stax-api.jar wstx.jar</Class-Path>
</manifestEntries>
</archive>
</configuration>
14 years, 7 months
JBossWS SVN: r12197 - stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-07 13:19:51 -0400 (Fri, 07 May 2010)
New Revision: 12197
Added:
stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java
Removed:
stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyServiceDelegate.java
Modified:
stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java
Log:
[JBPAPP-4248] Refactor ServiceObjectFactory (merge 10370 from trunk)
Modified: stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java 2010-05-07 15:42:12 UTC (rev 12196)
+++ stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java 2010-05-07 17:19:51 UTC (rev 12197)
@@ -23,6 +23,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.apache.cxf.configuration.Configurer;
import org.jboss.wsf.spi.WSFException;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
@@ -59,6 +60,7 @@
*
* @author Thomas.Diesler(a)jboss.com
* @author Richard.Opalka(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
*/
public class ServiceObjectFactory implements ObjectFactory
{
@@ -89,8 +91,6 @@
{
try
{
- BusFactory.setThreadDefaultBus(null); // cleanup thread locals before constructing Service
-
Reference ref = (Reference)obj;
// Get the target class name
@@ -98,6 +98,14 @@
// Unmarshall the UnifiedServiceRef
UnifiedServiceRefMetaData serviceRef = unmarshallServiceRef(ref);
+
+ //Reset bus before constructing Service
+ BusFactory.setThreadDefaultBus(null);
+ Bus bus = BusFactory.getThreadDefaultBus();
+ //Add extension to configure stub properties using the UnifiedServiceRefMetaData
+ Configurer configurer = bus.getExtension(Configurer.class);
+ bus.setExtension(new ServiceRefStubPropertyConfigurer(serviceRef, configurer), Configurer.class);
+
String serviceRefName = serviceRef.getServiceRefName();
QName serviceQName = serviceRef.getServiceQName();
@@ -151,9 +159,6 @@
}
}
- // Configure the service
- configureService((Service)target, serviceRef);
-
if (targetClassName != null && targetClassName.equals(serviceImplClass) == false)
{
try
@@ -189,11 +194,9 @@
if ((serviceRef.getHandlerChain() != null) && (target instanceof Service))
{
- Bus bus = BusFactory.getThreadDefaultBus();
((Service)target).setHandlerResolver(new HandlerResolverImpl(bus, serviceRef.getHandlerChain(), target.getClass()));
}
- hackServiceDelegate(target, serviceRef);
return target;
}
@@ -204,68 +207,6 @@
}
}
- // TODO: ugly hack that should be removed in the future
- private Object hackServiceDelegate(final Object service, final UnifiedServiceRefMetaData serviceRef) throws Throwable
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- {
- try
- {
- return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>()
- {
- public Object run() throws Exception
- {
- Field delegateField = findServiceDelegateField(service.getClass());
- if (delegateField != null)
- {
- delegateField.setAccessible(true);
- ServiceDelegate delegate = (ServiceDelegate)delegateField.get(service);
- delegateField.set(service, new ServiceRefStubPropertyServiceDelegate(delegate, serviceRef));
- return delegate;
- } else {
- return null;
- }
- }
- });
- }
- catch (PrivilegedActionException e)
- {
- throw e.getCause();
- }
- }
- Field delegateField = findServiceDelegateField(service.getClass());
- if (delegateField != null)
- {
- delegateField.setAccessible(true);
- ServiceDelegate delegate = (ServiceDelegate)delegateField.get(service);
- delegateField.set(service, new ServiceRefStubPropertyServiceDelegate(delegate, serviceRef));
- return delegate;
- } else {
- return null;
- }
- }
-
- private static Field findServiceDelegateField(Class<?> clazz)
- {
- while (clazz != null)
- {
- for (Field f : clazz.getDeclaredFields())
- {
- if (f.getType().equals(ServiceDelegate.class))
- return f;
- }
- clazz = clazz.getSuperclass();
- }
- return null;
- }
-
-
- private void configureService(Service service, UnifiedServiceRefMetaData serviceRef)
- {
- log.warn("Service configuration not available in Apache-CXF");
- }
-
private UnifiedServiceRefMetaData unmarshallServiceRef(Reference ref) throws ClassNotFoundException, NamingException
{
UnifiedServiceRefMetaData sref;
Copied: stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java (from rev 10370, stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java)
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java (rev 0)
+++ stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java 2010-05-07 17:19:51 UTC (rev 12197)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf.client;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
+
+/**
+ * A CXF configurer that sets the serviceref stub properties in the JaxWsProxyFactoryBean
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 21-Jul-2009
+ */
+public class ServiceRefStubPropertyConfigurer implements Configurer
+{
+ private UnifiedServiceRefMetaData serviceRefMD;
+ private Configurer delegate;
+
+ public ServiceRefStubPropertyConfigurer(UnifiedServiceRefMetaData serviceRefMD, Configurer delegate)
+ {
+ this.serviceRefMD = serviceRefMD;
+ this.delegate = delegate;
+ }
+
+ public void configureBean(Object beanInstance)
+ {
+ if (beanInstance instanceof JaxWsProxyFactoryBean)
+ {
+ configureJaxWsProxyFactoryBean((JaxWsProxyFactoryBean)beanInstance);
+ }
+ if (delegate != null)
+ {
+ delegate.configureBean(beanInstance);
+ }
+ }
+
+ public void configureBean(String name, Object beanInstance)
+ {
+ if (beanInstance instanceof JaxWsProxyFactoryBean)
+ {
+ configureJaxWsProxyFactoryBean((JaxWsProxyFactoryBean)beanInstance);
+ }
+ if (delegate != null)
+ {
+ delegate.configureBean(name, beanInstance);
+ }
+ }
+
+ private synchronized void configureJaxWsProxyFactoryBean(JaxWsProxyFactoryBean proxyFactory)
+ {
+ Map<String, Object> properties = new HashMap<String, Object>();
+ for (UnifiedPortComponentRefMetaData pcRef : serviceRefMD.getPortComponentRefs())
+ {
+ String sei = pcRef.getServiceEndpointInterface();
+ if (sei != null && sei.equals(proxyFactory.getServiceClass().getName()))
+ {
+ for (UnifiedStubPropertyMetaData prop : pcRef.getStubProperties())
+ {
+ properties.put(prop.getPropName(), prop.getPropValue());
+ }
+ }
+ }
+ proxyFactory.setProperties(properties);
+ }
+
+}
Deleted: stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyServiceDelegate.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyServiceDelegate.java 2010-05-07 15:42:12 UTC (rev 12196)
+++ stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyServiceDelegate.java 2010-05-07 17:19:51 UTC (rev 12197)
@@ -1,247 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.cxf.client;
-
-import java.net.URL;
-import java.util.Iterator;
-import java.util.concurrent.Executor;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Dispatch;
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServiceFeature;
-import javax.xml.ws.Service.Mode;
-import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.ws.spi.ServiceDelegate;
-
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
-
-/**
- * ServiceDelegate that propagates service ref stub properties
- *
- * @author richard.opalka(a)jboss.com
- */
-public final class ServiceRefStubPropertyServiceDelegate extends ServiceDelegate
-{
-
- private ServiceDelegate delegate;
- private UnifiedServiceRefMetaData serviceRefMD;
-
- ServiceRefStubPropertyServiceDelegate(ServiceDelegate delegate, UnifiedServiceRefMetaData serviceRefMD)
- {
- this.delegate = delegate;
- this.serviceRefMD = serviceRefMD;
- }
-
- private <T> T propagateProps(T proxy, Class<T> serviceEndpointInterface)
- {
- for (UnifiedPortComponentRefMetaData pcRef : serviceRefMD.getPortComponentRefs())
- {
- String sei = pcRef.getServiceEndpointInterface();
- if (sei != null && sei.equals(serviceEndpointInterface.getName()) && proxy instanceof BindingProvider)
- {
- BindingProvider bp = (BindingProvider)proxy;
- for (UnifiedStubPropertyMetaData prop : pcRef.getStubProperties())
- {
- bp.getRequestContext().put(prop.getPropName(), prop.getPropValue());
- }
- }
- }
- return proxy;
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#addPort(javax.xml.namespace.QName, java.lang.String, java.lang.String)
- */
- @Override
- public void addPort(QName portName, String bindingId, String endpointAddress)
- {
- this.delegate.addPort(portName, bindingId, endpointAddress);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#createDispatch(javax.xml.ws.EndpointReference, java.lang.Class, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public <T> Dispatch<T> createDispatch(EndpointReference endpointReference, Class<T> type, Mode mode, WebServiceFeature... features)
- {
- return this.delegate.createDispatch(endpointReference, type, mode, features);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#createDispatch(javax.xml.ws.EndpointReference, javax.xml.bind.JAXBContext, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public Dispatch<Object> createDispatch(EndpointReference endpointReference, JAXBContext context, Mode mode, WebServiceFeature... features)
- {
- return this.delegate.createDispatch(endpointReference, context, mode, features);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#createDispatch(javax.xml.namespace.QName, java.lang.Class, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode, WebServiceFeature... features)
- {
- return this.delegate.createDispatch(portName, type, mode, features);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#createDispatch(javax.xml.namespace.QName, java.lang.Class, javax.xml.ws.Service.Mode)
- */
- @Override
- public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode)
- {
- return this.delegate.createDispatch(portName, type, mode);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#createDispatch(javax.xml.namespace.QName, javax.xml.bind.JAXBContext, javax.xml.ws.Service.Mode, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public Dispatch<Object> createDispatch(QName portName, JAXBContext context, Mode mode, WebServiceFeature... features)
- {
- return this.delegate.createDispatch(portName, context, mode, features);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#createDispatch(javax.xml.namespace.QName, javax.xml.bind.JAXBContext, javax.xml.ws.Service.Mode)
- */
- @Override
- public Dispatch<Object> createDispatch(QName portName, JAXBContext context, Mode mode)
- {
- return this.delegate.createDispatch(portName, context, mode);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getExecutor()
- */
- @Override
- public Executor getExecutor()
- {
- return this.delegate.getExecutor();
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getHandlerResolver()
- */
- @Override
- public HandlerResolver getHandlerResolver()
- {
- return this.delegate.getHandlerResolver();
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getPort(java.lang.Class, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public <T> T getPort(Class<T> serviceEndpointInterface, WebServiceFeature... features)
- {
- return this.propagateProps(this.delegate.getPort(serviceEndpointInterface, features), serviceEndpointInterface);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getPort(java.lang.Class)
- */
- @Override
- public <T> T getPort(Class<T> serviceEndpointInterface)
- {
- return this.propagateProps(this.delegate.getPort(serviceEndpointInterface), serviceEndpointInterface);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getPort(javax.xml.ws.EndpointReference, java.lang.Class, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features)
- {
- return this.propagateProps(this.delegate.getPort(endpointReference, serviceEndpointInterface, features), serviceEndpointInterface);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getPort(javax.xml.namespace.QName, java.lang.Class, javax.xml.ws.WebServiceFeature[])
- */
- @Override
- public <T> T getPort(QName portName, Class<T> serviceEndpointInterface, WebServiceFeature... features)
- {
- return this.propagateProps(this.delegate.getPort(portName, serviceEndpointInterface, features), serviceEndpointInterface);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getPort(javax.xml.namespace.QName, java.lang.Class)
- */
- @Override
- public <T> T getPort(QName portName, Class<T> serviceEndpointInterface)
- {
- return this.propagateProps(this.delegate.getPort(portName, serviceEndpointInterface), serviceEndpointInterface);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getPorts()
- */
- @Override
- public Iterator<QName> getPorts()
- {
- return this.delegate.getPorts();
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getServiceName()
- */
- @Override
- public QName getServiceName()
- {
- return this.delegate.getServiceName();
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#getWSDLDocumentLocation()
- */
- @Override
- public URL getWSDLDocumentLocation()
- {
- return this.delegate.getWSDLDocumentLocation();
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#setExecutor(java.util.concurrent.Executor)
- */
- @Override
- public void setExecutor(Executor executor)
- {
- this.delegate.setExecutor(executor);
- }
-
- /* (non-Javadoc)
- * @see javax.xml.ws.spi.ServiceDelegate#setHandlerResolver(javax.xml.ws.handler.HandlerResolver)
- */
- @Override
- public void setHandlerResolver(HandlerResolver handlerResolver)
- {
- this.delegate.setHandlerResolver(handlerResolver);
- }
-
-}
14 years, 7 months
JBossWS SVN: r12196 - in stack/cxf/branches/jbossws-cxf-3.1.2/modules: testsuite and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-07 11:42:12 -0400 (Fri, 07 May 2010)
New Revision: 12196
Added:
stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AddressRewritingEndpointInfo.java
Modified:
stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SoapTransportFactoryExt.java
stack/cxf/branches/jbossws-cxf-3.1.2/modules/testsuite/test-excludes-jboss510.txt
Log:
[JBPAPP-4245] Endpoint address rewrite and multiple virtual host support (merge revisions 10401,10440,10462,10464,10600)
Copied: stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AddressRewritingEndpointInfo.java (from rev 10462, stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AddressRewritingEndpointInfo.java)
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AddressRewritingEndpointInfo.java (rev 0)
+++ stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AddressRewritingEndpointInfo.java 2010-05-07 15:42:12 UTC (rev 12196)
@@ -0,0 +1,214 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf;
+
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.tools.common.extensions.soap.SoapAddress;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.management.ServerConfig;
+
+/**
+ * A custom EndpointInfo that updates the SoapAddress extension
+ * coming from the wsdl definition according to the JBossWS
+ * soap address rewrite rules.
+ *
+ * @see org.apache.cxf.binding.soap.SoapTransportFactory.SoapEndpointInfo
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 03-Aug-2009
+ *
+ */
+public class AddressRewritingEndpointInfo extends EndpointInfo
+{
+ private static Logger log = Logger.getLogger(AddressRewritingEndpointInfo.class);
+
+ private ServerConfig serverConfig;
+ SoapAddress saddress;
+
+ AddressRewritingEndpointInfo(ServiceInfo serv, String trans, ServerConfig serverConfig)
+ {
+ super(serv, trans);
+ this.serverConfig = serverConfig;
+ }
+
+ /**
+ * This is the method responsible for both setting the EndpointInfo address and
+ * setting the soap:address in the wsdl.
+ * While the former action is straightforward, the latter is performed according
+ * to the JBossWS configuration: every time CXF updates the EndpointInfo address
+ * (which usually happens twice) this makes sure a proper address is updated in
+ * the wsdl.
+ *
+ * {@inheritDoc}
+ */
+ public void setAddress(String s)
+ {
+ String previousAddress = super.getAddress();
+ super.setAddress(s);
+ boolean setNewAddress = false;
+ if (previousAddress == null)
+ {
+ setNewAddress = true;
+ }
+ else if (isRewriteAllowed(s) && isRewriteRequired(s, previousAddress))
+ {
+ String uriScheme = getUriScheme(s);
+ //we set https if the transport guarantee is CONFIDENTIAL or the previous address already used https
+ //(if the original wsdl soap:address uses https we can't overwrite it with http)
+ if ("https".equalsIgnoreCase(getUriScheme(previousAddress)))
+ {
+ uriScheme = "https";
+ }
+ if (uriScheme == null)
+ {
+ uriScheme = "http";
+ }
+ //rewrite the candidate new address
+ s = rewriteSoapAddress(s, uriScheme);
+ setNewAddress = true;
+ }
+ if (setNewAddress && saddress != null)
+ {
+ log.info("Setting new service endpoint address in wsdl: " + s);
+ saddress.setLocationURI(s);
+ }
+ }
+
+ public void addExtensor(Object el)
+ {
+ super.addExtensor(el);
+ if (el instanceof SoapAddress)
+ {
+ saddress = (SoapAddress)el;
+ }
+ }
+
+ protected boolean isRewriteAllowed(String address)
+ {
+ //exclude non http addresses
+ return (address != null && address.trim().toLowerCase().startsWith("http"));
+ }
+
+
+ protected boolean isRewriteRequired(String address, String previousAddress)
+ {
+ //check config prop forcing address rewrite
+ if (serverConfig.isModifySOAPAddress())
+ {
+ log.debug("Rewrite required because of configuration");
+ return true;
+ }
+ //check if the previous address is not valid
+ if (isInvalidAddress(previousAddress))
+ {
+ log.debug("Rewrite required because of invalid url");
+ return true;
+ }
+ log.debug("Rewrite not required");
+ return false;
+ }
+
+ protected boolean isInvalidAddress(String address)
+ {
+ if (address == null)
+ {
+ return true;
+ }
+ String s = address.trim();
+ if (s.length() == 0 || s.contains("REPLACE_WITH_ACTUAL_URL"))
+ {
+ return true;
+ }
+ try
+ {
+ new URL(s);
+ }
+ catch (Exception e)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Rewrite the provided address according to the current server
+ * configuration and always using the specified uriScheme.
+ *
+ * @param s The source address
+ * @param uriScheme The uriScheme to use for rewrite
+ * @return The obtained address
+ */
+ protected String rewriteSoapAddress(String s, String uriScheme)
+ {
+ try
+ {
+ URL url = new URL(s);
+ String path = url.getPath();
+ String host = serverConfig.getWebServiceHost();
+ String port = "";
+ if ("https".equals(uriScheme))
+ {
+ int portNo = serverConfig.getWebServiceSecurePort();
+ if (portNo != 443)
+ {
+ port = ":" + portNo;
+ }
+ }
+ else
+ {
+ int portNo = serverConfig.getWebServicePort();
+ if (portNo != 80)
+ {
+ port = ":" + portNo;
+ }
+ }
+ String urlStr = uriScheme + "://" + host + port + path;
+ log.debug("Rewritten new candidate service endpoint address '" + s + "' to '" + urlStr + "'");
+ return urlStr;
+ }
+ catch (Exception e)
+ {
+ log.debug("Invalid url provided, using it without rewriting: " + s);
+ return s;
+ }
+ }
+
+ private static String getUriScheme(String address)
+ {
+ try
+ {
+ URI addrURI = new URI(address);
+ String scheme = addrURI.getScheme();
+ return scheme;
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file
Modified: stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2010-05-07 15:39:32 UTC (rev 12195)
+++ stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2010-05-07 15:42:12 UTC (rev 12196)
@@ -36,13 +36,6 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.binding.soap.SoapTransportFactory;
-import org.apache.cxf.configuration.Configurer;
-import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.endpoint.ServerRegistry;
-import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
-import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
-import org.apache.cxf.management.InstrumentationManager;
-import org.apache.cxf.management.counters.CounterRepository;
import org.apache.cxf.resource.ResourceManager;
import org.apache.cxf.resource.ResourceResolver;
import org.apache.cxf.transport.DestinationFactoryManager;
@@ -102,7 +95,6 @@
ApplicationContext appCtx = (ApplicationContext)svCtx.getAttribute("org.springframework.web.context.WebApplicationContext.ROOT");
Bus bus = getBus();
-
//Install our SoapTransportFactory to allow for proper soap address rewrite
DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
SoapTransportFactory factory = new SoapTransportFactoryExt();
Modified: stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2010-05-07 15:39:32 UTC (rev 12195)
+++ stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/ServletControllerExt.java 2010-05-07 15:42:12 UTC (rev 12196)
@@ -39,6 +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
@@ -51,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)
{
@@ -58,6 +65,8 @@
this.cxfTransport = cxfTransport;
this.servletCtx = servletCtx;
this.bus = bus;
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
}
/**
@@ -126,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())
{
Modified: stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SoapTransportFactoryExt.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SoapTransportFactoryExt.java 2010-05-07 15:39:32 UTC (rev 12195)
+++ stack/cxf/branches/jbossws-cxf-3.1.2/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SoapTransportFactoryExt.java 2010-05-07 15:42:12 UTC (rev 12196)
@@ -52,7 +52,6 @@
*/
public class SoapTransportFactoryExt extends SoapTransportFactory
{
- private static Logger log = Logger.getLogger(SoapTransportFactoryExt.class);
private ServerConfig serverConfig;
public EndpointInfo createEndpointInfo(ServiceInfo serviceInfo, BindingInfo b, Port port)
@@ -64,7 +63,7 @@
transportURI = sbi.getTransportURI();
}
ServerConfig config = getServerConfig();
- EndpointInfo info = new CustomSoapEndpointInfo(serviceInfo, transportURI, config != null && config.isModifySOAPAddress());
+ EndpointInfo info = new AddressRewritingEndpointInfo(serviceInfo, transportURI, config);
if (port != null)
{
List ees = port.getExtensibilityElements();
@@ -97,64 +96,4 @@
}
return serverConfig;
}
-
- /**
- * A custom EndpointInfo that updates the SoapAddress extension
- * coming from the wsdl definition according to the JBossWS
- * soap address rewrite rules.
- *
- */
- private class CustomSoapEndpointInfo extends EndpointInfo
- {
- boolean alwaysModifyWsdl;
- SoapAddress saddress;
-
- CustomSoapEndpointInfo(ServiceInfo serv, String trans, boolean alwaysModifyWsdl)
- {
- super(serv, trans);
- this.alwaysModifyWsdl = alwaysModifyWsdl;
- }
-
- public void setAddress(String s)
- {
- boolean currentInvalid = isCurrentAddressInvalid();
- super.setAddress(s);
- if (alwaysModifyWsdl || currentInvalid)
- {
- log.info("Setting new address: " + s);
- if (saddress != null)
- {
- saddress.setLocationURI(s);
- }
- }
- }
-
- public void addExtensor(Object el)
- {
- super.addExtensor(el);
- if (el instanceof SoapAddress)
- {
- saddress = (SoapAddress)el;
- }
- }
-
- private boolean isCurrentAddressInvalid()
- {
- String address = super.getAddress();
- if (address != null)
- {
- try
- {
- new URL(address);
- }
- catch (MalformedURLException e)
- {
- log.info("Forcing rewrite of invalid address: " + address);
- return true;
- }
- }
- return false;
- }
- }
-
}
Modified: stack/cxf/branches/jbossws-cxf-3.1.2/modules/testsuite/test-excludes-jboss510.txt
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.1.2/modules/testsuite/test-excludes-jboss510.txt 2010-05-07 15:39:32 UTC (rev 12195)
+++ stack/cxf/branches/jbossws-cxf-3.1.2/modules/testsuite/test-excludes-jboss510.txt 2010-05-07 15:42:12 UTC (rev 12196)
@@ -8,9 +8,6 @@
# [CXF-1511] WrappedMessageContext does not implement SOAPMessageContext
org/jboss/test/ws/jaxws/binding/**
-# [CXF-1514][JBWS-2247] Generated WSDL does not take 'transport-guarantee' in web.xml into account
-org/jboss/test/ws/jaxws/jbws1190/**
-
# [CXF-1516] Type inheritance with document/literal/bare
org/jboss/test/ws/jaxws/jbws1702/**
@@ -29,9 +26,6 @@
# [EJBTHREE-1152] service-ref in ejb-jar.xml is ignored
org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefEJBTestCase.*
-# [JBWS-1655] Add support for endpoint address rewriting
-org/jboss/test/ws/jaxws/jbws2150/**
-
# [JBWS-2596] Resource injection in jaxws endpoints and handlers
org/jboss/test/ws/jaxws/jbws2074/**
org/jboss/test/ws/jaxws/jbws2634/**
@@ -42,9 +36,6 @@
# [JBWS-2571] Mode.INOUT parameter not generated
org/jboss/test/ws/jaxws/holder/**
-# [JBWS-2227] Investigate why multiple virtual hosts test fails on CXF
-org/jboss/test/ws/jaxws/jbws1178/**
-
# [JBWS-2480] Soap attachments are dropped on server response
org/jboss/test/ws/jaxws/jbws1283/**
14 years, 7 months
JBossWS SVN: r12195 - in framework/branches/jbossws-framework-3.1.2: src/main/java/org/jboss/wsf/framework/management and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-07 11:39:32 -0400 (Fri, 07 May 2010)
New Revision: 12195
Modified:
framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java
framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/Endpoint.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/EndpointImpl.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCase.java
Log:
[JBPAPP-4245] Endpoint address rewrite and multiple virtual host support (merge revisions 10463,10483,10484)
Modified: framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java 2010-05-07 14:09:31 UTC (rev 12194)
+++ framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java 2010-05-07 15:39:32 UTC (rev 12195)
@@ -21,13 +21,22 @@
*/
package org.jboss.wsf.framework.deployment;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.annotation.WebContext;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.management.ServerConfigFactory;
+import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData.JSEResourceCollection;
/**
* A deployer that assigns the endpoint address.
@@ -50,10 +59,12 @@
String host = serverConfig.getWebServiceHost();
int port = serverConfig.getWebServicePort();
- String hostAndPort = host + (port > 0 ? ":" + port : "");
-
+ int securePort = serverConfig.getWebServiceSecurePort();
for (Endpoint ep : dep.getService().getEndpoints())
{
+ boolean confidential = isConfidentialTransportGuarantee(dep, ep);
+ int currentPort = confidential ? securePort : port;
+ String hostAndPort = host + (currentPort > 0 ? ":" + currentPort : "");
String urlPattern = ep.getURLPattern();
if (urlPattern == null)
throw new IllegalStateException("Cannot obtain url pattern");
@@ -61,7 +72,56 @@
if (urlPattern.endsWith("/*"))
urlPattern = urlPattern.substring(0, urlPattern.length() - 2);
- ep.setAddress("http://" + hostAndPort + contextRoot + urlPattern);
+ String protocol = confidential ? "https://" : "http://";
+ ep.setAddress(protocol + hostAndPort + contextRoot + urlPattern);
}
}
+
+ protected boolean isConfidentialTransportGuarantee(Deployment dep, Endpoint ep)
+ {
+ String transportGuarantee = null;
+ if (DeploymentType.JAXWS_JSE == dep.getType())
+ {
+ JSEArchiveMetaData webMetaData = dep.getAttachment(JSEArchiveMetaData.class);
+ if (webMetaData != null)
+ {
+ String servletLink = ep.getShortName();
+ Map<String, String> servletMappings = webMetaData.getServletMappings();
+ String urlPattern = servletMappings.get(servletLink);
+
+ if (urlPattern == null)
+ throw new RuntimeException("Cannot find <url-pattern> for servlet-name: " + servletLink);
+
+ List<JSESecurityMetaData> securityList = webMetaData.getSecurityMetaData();
+ for (JSESecurityMetaData currentSecurity : securityList)
+ {
+ if (currentSecurity.getTransportGuarantee() != null && currentSecurity.getTransportGuarantee().length() > 0)
+ {
+ for (JSEResourceCollection currentCollection : currentSecurity.getWebResources())
+ {
+ for (String currentUrlPattern : currentCollection.getUrlPatterns())
+ {
+ if (urlPattern.equals(currentUrlPattern) || "/*".equals(currentUrlPattern))
+ {
+ transportGuarantee = currentSecurity.getTransportGuarantee();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ //TODO Unify annotation scans
+ Class implClass = ep.getTargetBeanClass();
+ WebContext anWebContext = (WebContext)implClass.getAnnotation(WebContext.class);
+ if (anWebContext != null)
+ {
+ transportGuarantee = anWebContext.transportGuarantee();
+ }
+ }
+ return "CONFIDENTIAL".equals(transportGuarantee);
+ }
+
}
Modified: framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java 2010-05-07 14:09:31 UTC (rev 12194)
+++ framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java 2010-05-07 15:39:32 UTC (rev 12195)
@@ -52,6 +52,11 @@
this.endpoint = endpoint;
this.mbeanServer = mbeanServer;
}
+
+ public String getAddress()
+ {
+ return endpoint.getAddress();
+ }
public long getAverageProcessingTime()
{
Modified: framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java 2010-05-07 14:09:31 UTC (rev 12194)
+++ framework/branches/jbossws-framework-3.1.2/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java 2010-05-07 15:39:32 UTC (rev 12195)
@@ -36,6 +36,8 @@
void start();
void stop();
+
+ String getAddress();
Date getStartTime();
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.java 2010-05-07 14:09:31 UTC (rev 12194)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.java 2010-05-07 15:39:32 UTC (rev 12195)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2009, 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,11 +36,9 @@
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class ConfidentialEndpoint
{
-
// Intentionally no @WebMethod, see above
public String helloWorld(final String message)
{
return message;
}
-
}
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/Endpoint.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/Endpoint.java 2010-05-07 14:09:31 UTC (rev 12194)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/Endpoint.java 2010-05-07 15:39:32 UTC (rev 12195)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2009, 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.
*
@@ -38,6 +38,6 @@
{
@WebMethod
- public void testAddress(final String archive, final String service, final String scheme, final String port);
+ public void test();
}
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/EndpointImpl.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/EndpointImpl.java 2010-05-07 14:09:31 UTC (rev 12194)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/EndpointImpl.java 2010-05-07 15:39:32 UTC (rev 12195)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2009, 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.
*
@@ -21,25 +21,8 @@
*/
package org.jboss.test.ws.jaxws.jbws1190;
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.List;
-import java.util.Map;
-
import javax.jws.WebService;
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.WSDLException;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.management.ServerConfigFactory;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-
/**
* [JBWS-1190] - WSDL generated for JSR-181 POJO does not take 'transport-guarantee' in web.xml into account
*
@@ -51,84 +34,8 @@
@WebService(serviceName = "EndpointService", targetNamespace = "http://org.jboss/test/ws/jbws1190", endpointInterface = "org.jboss.test.ws.jaxws.jbws1190.Endpoint")
public class EndpointImpl implements Endpoint
{
-
- public void testAddress(final String archive, final String service, final String scheme, final String port)
+ public void test()
{
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();File tmpDir = serverConfig.getServerTempDir();
-
- File dataDir = serverConfig.getServerDataDir();
- File wsdlDir = new File(dataDir.getAbsolutePath() + File.separator + "wsdl" + File.separator + archive);
-
- if (wsdlDir.exists() == false)
- {
- throw new JBWS1190Exception(wsdlDir.getAbsolutePath() + " does not exist.");
- }
-
- File[] wsdls = wsdlDir.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name)
- {
- return name.startsWith(service);
- }
- });
-
- File wsdlFile = null;
- for (int i = 0; i < wsdls.length; i++)
- {
- if (wsdlFile == null || wsdls[i].compareTo(wsdlFile) > 0)
- {
- wsdlFile = wsdls[i];
- }
- }
- assertTrue("No WSDL files found", wsdlFile != null);
-
- Definition wsdl;
- try
- {
- WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
- wsdl = wsdlReader.readWSDL(wsdlFile.getAbsolutePath());
- }
- catch (WSDLException e)
- {
- throw new JBWS1190Exception("Error readin WSDL", e);
- }
-
- Map services = wsdl.getServices();
- assertEquals("No of services", 1, services.size());
-
- Service _service = (Service)services.values().iterator().next();
- Map ports = _service.getPorts();
- assertEquals("No of endpoints", 1, ports.size());
- Port _port = (Port)ports.values().iterator().next();
-
- List extElements = _port.getExtensibilityElements();
- String address = null;
- for (int i = 0; i < extElements.size(); i++)
- {
- if (extElements.get(i) instanceof SOAPAddress)
- {
- SOAPAddress soapAddrExtElement = (SOAPAddress)extElements.get(i);
- address = soapAddrExtElement.getLocationURI();
- }
- }
- assertTrue("Address is null", address != null);
- assertTrue("Expected Scheme '" + scheme + "' from address '" + address + "'", address.startsWith(scheme + "://"));
- assertTrue("Expected Port '" + port + "' from address '" + address + "'", address.indexOf(":" + port + "/") > -1);
+ System.out.println("test");
}
-
- private void assertEquals(final String message, final int expected, final int actual)
- {
- if (expected != actual)
- {
- throw new JBWS1190Exception(message + " expected=" + expected + " actual=" + actual);
- }
- }
-
- private void assertTrue(final String message, final boolean value)
- {
- if (value == false)
- {
- throw new JBWS1190Exception(message);
- }
- }
}
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java 2010-05-07 14:09:31 UTC (rev 12194)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java 2010-05-07 15:39:32 UTC (rev 12195)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2009, 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.
*
@@ -23,6 +23,8 @@
import java.net.URL;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
@@ -37,38 +39,30 @@
* http://jira.jboss.org/jira/browse/JBWS-1190
*
* @author darran.lofthouse(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
* @since 19-October-2006
*/
public class JBWS1190TestCase extends JBossWSTest
{
- private static final String ARCHIVE_NAME = "jaxws-jbws1190.war";
-
- private static Endpoint port;
-
public static Test suite()
{
- return new JBossWSTestSetup(JBWS1190TestCase.class, ARCHIVE_NAME);
+ return new JBossWSTestSetup(JBWS1190TestCase.class, "jaxws-jbws1190.war");
}
-
- protected void setUp() throws Exception
+
+ public void testEndpointAddress() throws Exception
{
- if (port == null)
- {
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws1190/Endpoint?wsdl");
- QName qname = new QName("http://org.jboss/test/ws/jbws1190", "EndpointService");
- Service service = Service.create(wsdlURL, qname);
- port = (Endpoint)service.getPort(Endpoint.class);
- }
+ MBeanServerConnection server = getServer();
+ ObjectName oname = new ObjectName("jboss.ws:context=jaxws-jbws1190,endpoint=Endpoint");
+ String address = (String)server.getAttribute(oname, "Address");
+ assertTrue("Expected http address, but got: " + address, address.startsWith("http://"));
}
- public void testEndpoint() throws Exception
+ public void testConfidentialEndpointAddress() throws Exception
{
- port.testAddress(ARCHIVE_NAME, "EndpointService", "http", "8080");
+ MBeanServerConnection server = getServer();
+ ObjectName oname = new ObjectName("jboss.ws:context=jaxws-jbws1190,endpoint=ConfidentialEndpoint");
+ String address = (String)server.getAttribute(oname, "Address");
+ assertTrue("Expected https address, but got: " + address, address.startsWith("https://"));
}
-
- public void testConfidentialEndpoint() throws Exception
- {
- port.testAddress(ARCHIVE_NAME, "ConfidentialService", "https", "8443");
- }
}
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCase.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCase.java 2010-05-07 14:09:31 UTC (rev 12194)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCase.java 2010-05-07 15:39:32 UTC (rev 12195)
@@ -173,7 +173,9 @@
private ServiceIface getEndpoint(String wsdlLocation, String serviceName) throws Exception
{
- return Service.create(new URL(wsdlLocation), new QName(NAMESPACE, serviceName)).getPort(ServiceIface.class);
+ Service service = Service.create(new URL(wsdlLocation), new QName(NAMESPACE, serviceName));
+ QName portName = service.getPorts().next();
+ return service.getPort(portName, ServiceIface.class);
}
private Definition getWSDLDefinition(String wsdlLocation) throws Exception
14 years, 7 months
JBossWS SVN: r12194 - stack/cxf/branches/jbossws-cxf-3.1.2/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-07 10:09:31 -0400 (Fri, 07 May 2010)
New Revision: 12194
Modified:
stack/cxf/branches/jbossws-cxf-3.1.2/modules/testsuite/test-excludes-jboss510.txt
Log:
[JBPAPP-4124] Enable passing test due to Apache CXF upgrade
Modified: stack/cxf/branches/jbossws-cxf-3.1.2/modules/testsuite/test-excludes-jboss510.txt
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.1.2/modules/testsuite/test-excludes-jboss510.txt 2010-05-07 13:45:13 UTC (rev 12193)
+++ stack/cxf/branches/jbossws-cxf-3.1.2/modules/testsuite/test-excludes-jboss510.txt 2010-05-07 14:09:31 UTC (rev 12194)
@@ -5,9 +5,6 @@
org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.*
org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.*
-# [CXF-1510] Cannot handle anonymous bare requests
-org/jboss/test/ws/jaxws/anonymous/**
-
# [CXF-1511] WrappedMessageContext does not implement SOAPMessageContext
org/jboss/test/ws/jaxws/binding/**
14 years, 7 months
JBossWS SVN: r12193 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-05-07 09:45:13 -0400 (Fri, 07 May 2010)
New Revision: 12193
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
Log:
refactoring
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2010-05-07 13:23:48 UTC (rev 12192)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2010-05-07 13:45:13 UTC (rev 12193)
@@ -35,6 +35,7 @@
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AttributedURI;
import javax.xml.ws.addressing.JAXWSAConstants;
import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
@@ -96,7 +97,10 @@
SOAPAddressingProperties addrProps = (SOAPAddressingProperties) ADDR_BUILDER.newAddressingProperties();
SOAPMessage soapMessage = ((SOAPMessageContext) msgContext).getMessage();
+ //OperationMetaData operationMD = this.getOperationMetaData(msgContext);
+ //AddressingOpMetaExt addressingMD = this.getAddressingMetaData(msgContext);
CommonMessageContext commonMsgContext = (CommonMessageContext) msgContext;
+
if (this.isAddressingRequired(msgContext))
{
try
@@ -214,42 +218,60 @@
if (inProps != null)
outProps.initializeAsReply(inProps, isFault);
- try
+ OperationMetaData operationMD = this.getOperationMetaData(msgContext);
+ AddressingOpMetaExt addressingMD = this.getAddressingMetaData(msgContext);
+
+ if (!isFault && !operationMD.isOneWay())
{
- // supply the response action
- CommonMessageContext commonCtx = (CommonMessageContext) msgContext;
- OperationMetaData operationMD = commonCtx.getOperationMetaData();
+ outProps.setAction(this.newURI(addressingMD.getOutboundAction()));
+ }
+ else if (isFault)
+ {
+ String faultAction = this.getFaultAction(msgContext);
- AddressingOpMetaExt addressingMD = (AddressingOpMetaExt) operationMD.getExtension(ADDR_CONSTANTS
- .getNamespaceURI());
+ outProps.setAction(this.newURI(faultAction));
+ }
- if (addressingMD == null)
- throw new IllegalStateException("Addressing meta data not available");
+ outProps.writeHeaders(soapMessage);
+ }
- if (!isFault && !operationMD.isOneWay())
- {
- outProps.setAction(ADDR_BUILDER.newURI(addressingMD.getOutboundAction()));
- }
- else if (isFault)
- {
- Throwable exception = commonCtx.getCurrentException();
- String faultAction = getFaultAction(operationMD, addressingMD, exception);
-
- outProps.setAction(ADDR_BUILDER.newURI(faultAction));
- }
-
+ private AttributedURI newURI(final String uri) // TODO: client addressing handler have the same method - refactor it to some helper class
+ {
+ try
+ {
+ return ADDR_BUILDER.newURI(uri);
}
catch (URISyntaxException e)
{
- log.error("Error setting response action", e);
+ throw new WebServiceException(e.getMessage(), e);
}
+ }
- outProps.writeHeaders(soapMessage);
+ private OperationMetaData getOperationMetaData(final MessageContext msgContext)
+ {
+ CommonMessageContext commonCtx = (CommonMessageContext) msgContext;
+
+ return commonCtx.getOperationMetaData();
}
- private String getFaultAction(final OperationMetaData operationMD, final AddressingOpMetaExt addressingMD,
- final Throwable exception)
+ private AddressingOpMetaExt getAddressingMetaData(final MessageContext msgContext)
{
+ OperationMetaData operationMD = this.getOperationMetaData(msgContext);
+
+ AddressingOpMetaExt addressingMD = (AddressingOpMetaExt) operationMD.getExtension(ADDR_CONSTANTS
+ .getNamespaceURI());
+
+ if (addressingMD == null)
+ throw new IllegalStateException("Addressing meta data not available");
+
+ return addressingMD;
+ }
+
+ private String getFaultAction(final MessageContext msgContext)
+ {
+ final OperationMetaData operationMD = this.getOperationMetaData(msgContext);
+ final AddressingOpMetaExt addressingMD = this.getAddressingMetaData(msgContext);
+ final Throwable exception = ((CommonMessageContext) msgContext).getCurrentException();
final FaultMetaData faultMD = operationMD.getFaultMetaData(exception.getClass());
if (faultMD != null)
14 years, 7 months
JBossWS SVN: r12192 - stack/cxf/branches/jbossws-cxf-3.1.2.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-07 09:23:48 -0400 (Fri, 07 May 2010)
New Revision: 12192
Modified:
stack/cxf/branches/jbossws-cxf-3.1.2/pom.xml
Log:
[JBPAPP-4124] Move to Apache CXF 2.2.6 (merge revision 11804)
Modified: stack/cxf/branches/jbossws-cxf-3.1.2/pom.xml
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.1.2/pom.xml 2010-05-07 12:50:34 UTC (rev 12191)
+++ stack/cxf/branches/jbossws-cxf-3.1.2/pom.xml 2010-05-07 13:23:48 UTC (rev 12192)
@@ -52,7 +52,7 @@
<jbossws.jboss510.version>3.1.0-SNAPSHOT</jbossws.jboss510.version>
-->
<!-- END -->
- <cxf.version>2.2.5</cxf.version>
+ <cxf.version>2.2.6</cxf.version>
<cxf.spring.version>2.5.6.SEC01</cxf.spring.version>
<cxf.stax.version>1.0.1</cxf.stax.version>
<cxf.asm.version>3.1</cxf.asm.version>
14 years, 7 months