JBossWS SVN: r19649 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-04-16 12:08:19 -0400 (Thu, 16 Apr 2015)
New Revision: 19649
Modified:
stack/cxf/trunk/pom.xml
Log:
Use latest CRs
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2015-04-16 16:01:28 UTC (rev 19648)
+++ stack/cxf/trunk/pom.xml 2015-04-16 16:08:19 UTC (rev 19649)
@@ -61,8 +61,8 @@
<!-- Properties -->
<properties>
- <jbossws.api.version>1.0.3.CR2</jbossws.api.version>
- <jbossws.spi.version>3.0.0-SNAPSHOT</jbossws.spi.version>
+ <jbossws.api.version>1.0.3.CR3</jbossws.api.version>
+ <jbossws.spi.version>3.0.0.CR1</jbossws.spi.version>
<jbossws.common.version>3.0.0-SNAPSHOT</jbossws.common.version>
<jbossws.common.tools.version>1.2.1.CR1</jbossws.common.tools.version>
<jbossws.wildfly800.version>5.0.0-SNAPSHOT</jbossws.wildfly800.version>
9 years, 8 months
JBossWS SVN: r19647 - spi/tags.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-04-16 11:54:49 -0400 (Thu, 16 Apr 2015)
New Revision: 19647
Added:
spi/tags/jbossws-spi-3.0.0.CR1/
Log:
Tagging jbossws-spi-3.0.0.CR1
9 years, 8 months
JBossWS SVN: r19646 - api/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-04-16 11:53:35 -0400 (Thu, 16 Apr 2015)
New Revision: 19646
Modified:
api/trunk/pom.xml
Log:
Use latest parent
Modified: api/trunk/pom.xml
===================================================================
--- api/trunk/pom.xml 2015-04-16 15:52:01 UTC (rev 19645)
+++ api/trunk/pom.xml 2015-04-16 15:53:35 UTC (rev 19646)
@@ -13,7 +13,7 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.1.0.GA</version>
+ <version>1.2.0.CR1</version>
</parent>
<!-- Source Control Management -->
9 years, 8 months
JBossWS SVN: r19644 - api/tags.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-04-16 11:48:36 -0400 (Thu, 16 Apr 2015)
New Revision: 19644
Added:
api/tags/jbossws-api-1.0.3.CR3/
Log:
Tagging jbossws-api 1.0.3.CR3
9 years, 8 months
JBossWS SVN: r19643 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2015-04-16 09:19:03 -0400 (Thu, 16 Apr 2015)
New Revision: 19643
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/TestServlet.java
Log:
No need to call Endpoint.publish() as the endpoint is already deployed by the stack integration
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/TestServlet.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/TestServlet.java 2015-04-16 10:19:15 UTC (rev 19642)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/TestServlet.java 2015-04-16 13:19:03 UTC (rev 19643)
@@ -30,7 +30,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.namespace.QName;
-import javax.xml.ws.Endpoint;
import javax.xml.ws.Service;
import org.apache.cxf.Bus;
@@ -52,8 +51,6 @@
//start a new bus to avoid affecting the one that could already be assigned to this thread
Bus bus = BusFactory.newInstance().createBus();
BusFactory.setThreadDefaultBus(bus);
- Object implementor = new HelloWorldImpl();
- Endpoint ep = Endpoint.publish("jms:queue:testQueue", implementor);
try
{
//use HelloWorldServiceLocal service which has local connection factory references (we're running on the same JVM here)
@@ -65,7 +62,6 @@
}
finally
{
- ep.stop();
bus.shutdown(true);
}
res.getWriter().print(result);
9 years, 8 months
JBossWS SVN: r19642 - in stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf: interceptor and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2015-04-16 06:19:15 -0400 (Thu, 16 Apr 2015)
New Revision: 19642
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/MessagePropertySettingInterceptor.java
Removed:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EnableDecoupledFaultInterceptor.java
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EndpointAssociationInterceptor.java
Log:
[JBWS-3905]:Fix NPE;Refactor work to better name the new added interceptor
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2015-04-16 09:44:59 UTC (rev 19641)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2015-04-16 10:19:15 UTC (rev 19642)
@@ -70,7 +70,7 @@
import org.jboss.wsf.stack.cxf.client.configuration.InterceptorUtils;
import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
import org.jboss.wsf.stack.cxf.extensions.policy.PolicySetsAnnotationListener;
-import org.jboss.wsf.stack.cxf.interceptor.EnableDecoupledFaultInterceptor;
+import org.jboss.wsf.stack.cxf.interceptor.MessagePropertySettingInterceptor;
import org.jboss.wsf.stack.cxf.interceptor.EndpointAssociationInterceptor;
import org.jboss.wsf.stack.cxf.interceptor.HandlerAuthInterceptor;
import org.jboss.wsf.stack.cxf.interceptor.NsCtxSelectorStoreInterceptor;
@@ -206,7 +206,7 @@
//Install the EndpointAssociationInterceptor for linking every message exchange
//with the proper spi Endpoint retrieved in CXFServletExt
bus.getInInterceptors().add(new EndpointAssociationInterceptor());
- bus.getInInterceptors().add(new EnableDecoupledFaultInterceptor());
+ bus.getInInterceptors().add(new MessagePropertySettingInterceptor());
bus.getInInterceptors().add(new NsCtxSelectorStoreInterceptor());
final String p = (props != null) ? props.get(Constants.JBWS_CXF_DISABLE_HANDLER_AUTH_CHECKS) : null;
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EnableDecoupledFaultInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EnableDecoupledFaultInterceptor.java 2015-04-16 09:44:59 UTC (rev 19641)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EnableDecoupledFaultInterceptor.java 2015-04-16 10:19:15 UTC (rev 19642)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.interceptor;
-
-import org.apache.cxf.message.Message;
-import org.apache.cxf.phase.AbstractPhaseInterceptor;
-import org.apache.cxf.phase.Phase;
-import org.apache.cxf.ws.addressing.soap.MAPCodec;
-
-/**
- * This interceptor adds the context property decoupled_fault_support
- * to enable decoupled faultTo. This is an optional feature in cxf and we
- * need this to be default to make it same behavior with native stack.
- * @author <a href="mailto:ema@redhat.com>Jim Ma</a>
- */
-public class EnableDecoupledFaultInterceptor extends AbstractPhaseInterceptor<Message>
-{
-
- public EnableDecoupledFaultInterceptor()
- {
- super(Phase.PRE_PROTOCOL);
- addBefore(MAPCodec.class.getName());
- }
-
- public void handleMessage(Message message)
- {
- message.put("org.apache.cxf.ws.addressing.decoupled_fault_support", true);
- }
-
- public void handleFault(Message message)
- {
- //complete
- }
-
-}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EndpointAssociationInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EndpointAssociationInterceptor.java 2015-04-16 09:44:59 UTC (rev 19641)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EndpointAssociationInterceptor.java 2015-04-16 10:19:15 UTC (rev 19642)
@@ -22,13 +22,11 @@
package org.jboss.wsf.stack.cxf.interceptor;
import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.interceptor.OneWayProcessorInterceptor;
import org.apache.cxf.message.Exchange;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.EndpointType;
import org.jboss.wsf.spi.invocation.EndpointAssociation;
/**
@@ -44,8 +42,7 @@
public class EndpointAssociationInterceptor extends AbstractPhaseInterceptor<Message>
{
- private EjbWSOneWayThreadInterceptor ejbOneWayInterceptor = new EjbWSOneWayThreadInterceptor();
-
+
public EndpointAssociationInterceptor()
{
super(Phase.RECEIVE);
@@ -56,31 +53,6 @@
{
Endpoint endpoint = EndpointAssociation.getEndpoint();
Exchange exchange = message.getExchange();
-
exchange.put(Endpoint.class, endpoint);
- message.getInterceptorChain().add(ejbOneWayInterceptor);
-
}
-
- public class EjbWSOneWayThreadInterceptor extends AbstractPhaseInterceptor<Message>
- {
- public EjbWSOneWayThreadInterceptor()
- {
- super(Phase.PRE_LOGICAL);
- this.addBefore(OneWayProcessorInterceptor.class.getName());
- }
-
- @Override
- public void handleMessage(Message message) throws Fault
- {
-
- Endpoint endpoint = message.getExchange().get(Endpoint.class);
- //Use original thread for oneway message to avoid authorization failure in ejb container for webservice endpoint
- if (endpoint.getType() == EndpointType.JAXWS_EJB3 && message.getExchange().isOneWay() && !isRequestor(message))
- {
- message.put(OneWayProcessorInterceptor.USE_ORIGINAL_THREAD, true);
- }
-
- }
- }
}
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/MessagePropertySettingInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/MessagePropertySettingInterceptor.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/MessagePropertySettingInterceptor.java 2015-04-16 10:19:15 UTC (rev 19642)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.interceptor;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.OneWayProcessorInterceptor;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.ws.addressing.soap.MAPCodec;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.EndpointType;
+
+/**
+ * This interceptor adds the following context properties to cxf message:
+ * <p>1.decoupled_fault_support<p>
+ * It enables decoupled faultTo. This is an optional feature in cxf and we
+ * need this to be default to make it same behavior with native stack.
+ * <p>2.OneWayProcessorInterceptor.USE_ORIGINAL_THREAD<p>
+ * This will force one way operation to use original thread for ejb webserivce endpoint
+ * <p>to avoid authorization failure from ejb container
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
+ */
+public class MessagePropertySettingInterceptor extends AbstractPhaseInterceptor<Message>
+{
+ private EjbWSOneWayThreadInterceptor ejbOneWayInterceptor = new EjbWSOneWayThreadInterceptor();
+
+ public MessagePropertySettingInterceptor()
+ {
+ super(Phase.PRE_PROTOCOL);
+ addBefore(MAPCodec.class.getName());
+ }
+
+ public void handleMessage(Message message)
+ {
+ message.put("org.apache.cxf.ws.addressing.decoupled_fault_support", true);
+ message.getInterceptorChain().add(ejbOneWayInterceptor);
+ }
+
+ public void handleFault(Message message)
+ {
+ //complete
+ }
+
+ public class EjbWSOneWayThreadInterceptor extends AbstractPhaseInterceptor<Message>
+ {
+ public EjbWSOneWayThreadInterceptor()
+ {
+ super(Phase.PRE_LOGICAL);
+ this.addBefore(OneWayProcessorInterceptor.class.getName());
+ }
+
+ @Override
+ public void handleMessage(Message message) throws Fault
+ {
+
+ Endpoint endpoint = message.getExchange().get(Endpoint.class);
+ if (endpoint == null)
+ {
+ return;
+ }
+ //Use original thread for oneway message to avoid authorization failure in ejb container for webservice endpoint
+ if (endpoint.getType() == EndpointType.JAXWS_EJB3 && message.getExchange().isOneWay() && !isRequestor(message))
+ {
+ message.put(OneWayProcessorInterceptor.USE_ORIGINAL_THREAD, true);
+ }
+
+ }
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/MessagePropertySettingInterceptor.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
9 years, 8 months
JBossWS SVN: r19641 - in stack/cxf/trunk/modules: testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws981 and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2015-04-16 05:44:59 -0400 (Thu, 16 Apr 2015)
New Revision: 19641
Added:
stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/IgnoreEnv.java
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws981/JBWS981TestCase.java
Log:
Ignore test for ipv6
Added: stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/IgnoreEnv.java
===================================================================
--- stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/IgnoreEnv.java (rev 0)
+++ stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/IgnoreEnv.java 2015-04-16 09:44:59 UTC (rev 19641)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2015, 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.test;
+
+import org.junit.Assume;
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+/**
+ * TestRule class to ignore test for some specific system property setting.
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
+ *
+ */
+public class IgnoreEnv implements TestRule {
+
+ public static final IgnoreEnv IPV6 = new IgnoreEnv("java.net.preferIPv6Addresses", "true");
+ public static final IgnoreEnv IPV4 = new IgnoreEnv("java.net.preferIPv4Stack", "true");
+ private String key;
+ private String value;
+ public IgnoreEnv(String key) {
+ this(key, null);
+ }
+
+ public IgnoreEnv(String key, String value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ @Override
+ public Statement apply(final Statement base, final Description description) {
+ return new Statement() {
+ boolean ignored = false;
+
+ @Override
+ public void evaluate() throws Throwable {
+
+ if (value != null) {
+ if (System.getProperty(key) != null && value.equals(System.getProperty(key))) {
+ ignored = true;
+ }
+ } else {
+ if (System.getProperty(key) != null) {
+ ignored = true;
+ }
+ }
+ Assume.assumeFalse(description.getClassName() + " is excluded for system env (" + key + ")", ignored);
+ }
+ };
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/test-utils/src/main/java/org/jboss/wsf/test/IgnoreEnv.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws981/JBWS981TestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws981/JBWS981TestCase.java 2015-04-16 09:02:29 UTC (rev 19640)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws981/JBWS981TestCase.java 2015-04-16 09:44:59 UTC (rev 19641)
@@ -32,7 +32,9 @@
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.wsf.test.IgnoreEnv;
import org.jboss.wsf.test.JBossWSTest;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -45,6 +47,9 @@
@RunWith(Arquillian.class)
public class JBWS981TestCase extends JBossWSTest
{
+ //Ignore this test for ipv6; it requires host setting in /etc/hosts [::1 localhost]
+ @Rule
+ public IgnoreEnv rule = IgnoreEnv.IPV6;
@ArquillianResource
private URL baseURL;
9 years, 8 months
JBossWS SVN: r19640 - in stack/cxf/trunk/modules: testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2015-04-16 05:02:29 -0400 (Thu, 16 Apr 2015)
New Revision: 19640
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/EnableRobustOneWayInterceptor.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl3.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/samples/securityDomain/jboss-webservices.xml
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EndpointAssociationInterceptor.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl2.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java
Log:
[JBWS-3905]:Use original thread for ejb webservice oneway operation to avoid authorization failure
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EndpointAssociationInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EndpointAssociationInterceptor.java 2015-04-15 21:46:07 UTC (rev 19639)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EndpointAssociationInterceptor.java 2015-04-16 09:02:29 UTC (rev 19640)
@@ -22,11 +22,13 @@
package org.jboss.wsf.stack.cxf.interceptor;
import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.OneWayProcessorInterceptor;
import org.apache.cxf.message.Exchange;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.EndpointType;
import org.jboss.wsf.spi.invocation.EndpointAssociation;
/**
@@ -42,17 +44,43 @@
public class EndpointAssociationInterceptor extends AbstractPhaseInterceptor<Message>
{
+ private EjbWSOneWayThreadInterceptor ejbOneWayInterceptor = new EjbWSOneWayThreadInterceptor();
+
public EndpointAssociationInterceptor()
{
super(Phase.RECEIVE);
}
-
+
@Override
public void handleMessage(Message message) throws Fault
{
Endpoint endpoint = EndpointAssociation.getEndpoint();
Exchange exchange = message.getExchange();
+
exchange.put(Endpoint.class, endpoint);
+ message.getInterceptorChain().add(ejbOneWayInterceptor);
+
}
+ public class EjbWSOneWayThreadInterceptor extends AbstractPhaseInterceptor<Message>
+ {
+ public EjbWSOneWayThreadInterceptor()
+ {
+ super(Phase.PRE_LOGICAL);
+ this.addBefore(OneWayProcessorInterceptor.class.getName());
+ }
+
+ @Override
+ public void handleMessage(Message message) throws Fault
+ {
+
+ Endpoint endpoint = message.getExchange().get(Endpoint.class);
+ //Use original thread for oneway message to avoid authorization failure in ejb container for webservice endpoint
+ if (endpoint.getType() == EndpointType.JAXWS_EJB3 && message.getExchange().isOneWay() && !isRequestor(message))
+ {
+ message.put(OneWayProcessorInterceptor.USE_ORIGINAL_THREAD, true);
+ }
+
+ }
+ }
}
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/EnableRobustOneWayInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/EnableRobustOneWayInterceptor.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/EnableRobustOneWayInterceptor.java 2015-04-16 09:02:29 UTC (rev 19640)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.test.ws.jaxws.samples.securityDomain;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.OneWayProcessorInterceptor;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.EndpointType;
+
+/**
+ * This class for test use to enable client to receive the authorization
+ * <p> exception for one way operation
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
+ *
+ */
+public class EnableRobustOneWayInterceptor extends AbstractPhaseInterceptor<Message>
+{
+ public EnableRobustOneWayInterceptor()
+ {
+ super(Phase.PRE_LOGICAL);
+ this.addBefore(OneWayProcessorInterceptor.class.getName());
+ }
+
+ @Override
+ public void handleMessage(Message message) throws Fault
+ {
+
+ Endpoint endpoint = message.getExchange().get(Endpoint.class);
+ //Use original thread for oneway message to avoid authorization failure in ejb container for webservice endpoint
+ if (endpoint.getType() == EndpointType.JAXWS_EJB3 && message.getExchange().isOneWay() && !isRequestor(message))
+ {
+ message.put(Message.ROBUST_ONEWAY, true);
+ }
+
+ }
+}
\ No newline at end of file
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/EnableRobustOneWayInterceptor.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl2.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl2.java 2015-04-15 21:46:07 UTC (rev 19639)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl2.java 2015-04-16 09:02:29 UTC (rev 19640)
@@ -30,6 +30,7 @@
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
+import org.apache.cxf.interceptor.InInterceptors;
import org.jboss.ejb3.annotation.SecurityDomain;
import org.jboss.logging.Logger;
import org.jboss.ws.api.annotation.AuthMethod;
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl3.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl3.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl3.java 2015-04-16 09:02:29 UTC (rev 19640)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2015, 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.test.ws.jaxws.samples.securityDomain;
+
+import javax.annotation.security.DeclareRoles;
+import javax.annotation.security.RolesAllowed;
+import javax.annotation.security.PermitAll;
+import javax.ejb.Stateless;
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+import org.jboss.ejb3.annotation.SecurityDomain;
+import org.jboss.logging.Logger;
+import org.jboss.ws.api.annotation.AuthMethod;
+import org.jboss.ws.api.annotation.TransportGuarantee;
+import org.jboss.ws.api.annotation.WebContext;
+
+@Stateless(name = "SecureEndpoint")
+@SOAPBinding(style = Style.RPC)
+@WebService
+(
+ name = "SecureEndpoint",
+ serviceName = "SecureEndpointService3",
+ targetNamespace = "http://org.jboss.ws/securityDomain"
+)
+@WebContext
+(
+ contextRoot="/jaxws-securityDomain3",
+ urlPattern="/authz",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.NONE,
+ secureWSDLAccess = false
+)
+@SecurityDomain("JBossWSSecurityDomainTest")
+@RolesAllowed("friend")
+public class SecureEndpointImpl3
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(SecureEndpointImpl3.class);
+
+ @WebMethod
+ public String echoForAll(String input)
+ {
+ log.info(input);
+ return input;
+ }
+ @Oneway
+ @WebMethod
+ public void helloOneWay(String input) {
+ log.info(input);
+ }
+ @WebMethod
+ public String echo(String input)
+ {
+ log.info(input);
+ return input;
+ }
+ @WebMethod
+ public String restrictedEcho(String input)
+ {
+ log.info(input);
+ return input;
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecureEndpointImpl3.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java 2015-04-15 21:46:07 UTC (rev 19639)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/securityDomain/SecurityDomainTestCase.java 2015-04-16 09:02:29 UTC (rev 19640)
@@ -27,6 +27,7 @@
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
import org.jboss.arquillian.container.test.api.Deployer;
import org.jboss.arquillian.container.test.api.Deployment;
@@ -35,6 +36,7 @@
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
@@ -62,6 +64,7 @@
{
private final static String DEPLOYMENT1 = "jaxws-samples-securityDomain";
private final static String DEPLOYMENT2 = "jaxws-samples-securityDomain2";
+ private final static String DEPLOYMENT3 = "jaxws-samples-securityDomain3";
@ArquillianResource
private URL baseURL;
@ArquillianResource
@@ -70,9 +73,11 @@
@Deployment(name= DEPLOYMENT1, testable = false)
public static JavaArchive createDeployment() {
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-samples-securityDomain.jar");
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.securityDomain.SecureEndpointImpl.class);
+ archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.apache.cxf.impl\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.securityDomain.SecureEndpointImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.securityDomain.EnableRobustOneWayInterceptor.class)
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/securityDomain/jboss-webservices.xml"), "jboss-webservices.xml");
return archive;
}
@Deployment(name= DEPLOYMENT2, testable = false)
@@ -84,6 +89,17 @@
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/securityDomain/jboss-ejb3.xml"), "jboss-ejb3.xml");
return archive;
}
+
+ @Deployment(name= DEPLOYMENT3, testable = false)
+ public static JavaArchive createDeployment3() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-samples-securityDomain3.jar");
+ archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.apache.cxf.impl\n"))
+ .addClass(org.jboss.test.ws.jaxws.samples.securityDomain.SecureEndpointImpl3.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.securityDomain.EnableRobustOneWayInterceptor.class)
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/securityDomain/jboss-webservices.xml"), "jboss-webservices.xml");
+ return archive;
+ }
private SecureEndpoint getAuthzPort() throws Exception
{
@@ -209,40 +225,17 @@
@Test
@RunAsClient
@OperateOnDeployment(DEPLOYMENT1)
- public void testOneWay() throws Exception
+ public void testMethodLevelRolesAllowedOneWay() throws Exception
{
//test unthenticated
SecureEndpoint port2 = getAuthzPort();
- try
- {
- port2.helloOneWay("Hello");
- fail("Authentication exception expected!");
- }
- catch (Exception e)
- {
- //expected web layer exception
- assertTrue(e.getMessage().contains("Could not send Message"));
- assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized"));
- }
- ((BindingProvider)port2).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "bob");
- ((BindingProvider)port2).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "foo");
- try {
- port2.helloOneWay("Hello");
- fail("Authorization exception expected!");
- } catch (Exception e) {
- //expected weblayer layer authorization exception
- assertTrue("Unexpected cause: " + e.getCause().getMessage(), e.getCause().getMessage().contains("403: Forbidden"));
- }
-
- ((BindingProvider)port2).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "john");
- ((BindingProvider)port2).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "bar");
- port2.helloOneWay("Hello");
- }
-
-
+ testOneWay(port2);
+ }
+
@Test
@RunAsClient
@OperateOnDeployment(DEPLOYMENT2)
+ //To test missing-method-permissions-deny-access is setting to false and defaultAccess() should be allowed
public void testEjbSecurityAuth() throws Exception
{
URL wsdlURL = new URL(baseURL + "/jaxws-securityDomain2/authz?wsdl");
@@ -273,5 +266,49 @@
assertEquals("Greetings", port.echo("Greetings"));
assertEquals("Greetings", port.restrictedEcho("Greetings"));
assertEquals("Greetings", port.defaultAccess("Greetings"));
- }
+ }
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(DEPLOYMENT3)
+ //To test one-way operaton with class level @RolesAllowed
+ public void testClassLevelRolesAllowedOneWay() throws Exception
+ {
+ //test unthenticated
+ URL wsdlURL = new URL(baseURL + "/jaxws-securityDomain3/authz?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/securityDomain", "SecureEndpointService3");
+ SecureEndpoint port = Service.create(wsdlURL, serviceName).getPort(SecureEndpoint.class);
+ testOneWay(port);
+ }
+ private void testOneWay(SecureEndpoint port) throws Exception {
+ try
+ {
+ port.helloOneWay("Hello");
+ fail("Authentication exception expected!");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ //expected web layer exception
+ assertTrue(e.getMessage().contains("Could not send Message"));
+ assertTrue("Exception Cause message: " + e.getCause().getMessage(), e.getCause().getMessage().contains("401: Unauthorized"));
+ }
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "bob");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "foo");
+ try {
+ port.helloOneWay("Hello");
+ fail("Authorization exception expected!");
+ } catch (WebServiceException e) {
+ //Do nothing
+ }
+
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "john");
+ ((BindingProvider)port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "bar");
+ try {
+ port.helloOneWay("Hello");
+
+ } catch (Exception e) {
+ fail("exception is unexpected!");
+ }
+ }
}
\ No newline at end of file
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/samples/securityDomain/jboss-webservices.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/samples/securityDomain/jboss-webservices.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/samples/securityDomain/jboss-webservices.xml 2015-04-16 09:02:29 UTC (rev 19640)
@@ -0,0 +1,11 @@
+<?xml version="1.1" encoding="UTF-8"?>
+<webservices
+ xmlns="http://www.jboss.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ version="1.2"
+ xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee">
+ <property>
+ <name>cxf.interceptors.in</name>
+ <value>org.jboss.test.ws.jaxws.samples.securityDomain.EnableRobustOneWayInterceptor</value>
+ </property>
+</webservices>
\ No newline at end of file
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/samples/securityDomain/jboss-webservices.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
9 years, 8 months