cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r949678 - in /cxf/trunk: rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/ systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/ systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/resources/
Date Mon, 31 May 2010 07:30:15 GMT
Author: ema
Date: Mon May 31 07:30:15 2010
New Revision: 949678

URL: http://svn.apache.org/viewvc?rev=949678&view=rev
Log:
[CXF-2834]:Check addressingDisabled property in Message before abort interceptorChain

Added:
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/resources/
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/resources/AddNumbersDispatchReq.xml
Modified:
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/WSADisableTest.java

Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java?rev=949678&r1=949677&r2=949678&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java (original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java Mon
May 31 07:30:15 2010
@@ -778,7 +778,9 @@ public class MAPCodec extends AbstractSo
                 if (ContextUtils.retrieveDeferUncorrelatedMessageAbort(message)) {
                     LOG.fine("deferring uncorrelated message abort");
                     ContextUtils.storeDeferredUncorrelatedMessageAbort(message);
-                } else {
+                } else if (!MessageUtils.getContextualBoolean(message,
+                                          "org.apache.cxf.ws.addressing.MAPAggregator.addressingDisabled",
+                                          false)) {
                     LOG.log(Level.WARNING, "CORRELATION_FAILURE_MSG");
                     message.getInterceptorChain().abort();
                 }

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/WSADisableTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/WSADisableTest.java?rev=949678&r1=949677&r2=949678&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/WSADisableTest.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/WSADisableTest.java
Mon May 31 07:30:15 2010
@@ -20,14 +20,20 @@
 package org.apache.cxf.systest.ws.addr_disable;
 
 import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
 import java.net.URL;
+
 import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPMessage;
 import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
 import javax.xml.ws.soap.AddressingFeature;
 
 import org.apache.cxf.systest.ws.AbstractWSATestBase;
 import org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType;
 import org.apache.cxf.systest.ws.addr_feature.AddNumbersService;
+
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -85,6 +91,28 @@ public class WSADisableTest extends Abst
         assertTrue(output.toString().indexOf(expectedOut) == -1);
         assertTrue(input.toString().indexOf(expectedIn) == -1);
     }
+    
+    
+    @Test
+    public void testDiaptchWithWsaDisable() throws Exception {
+
+        QName port = new QName("http://apache.org/cxf/systest/ws/addr_feature/", "AddNumbersPort");
+        Dispatch<SOAPMessage> disptch = getService().createDispatch(port, SOAPMessage.class,
+                                                                    javax.xml.ws.Service.Mode.MESSAGE,
+                                                                    new AddressingFeature(false));
+        ((BindingProvider)disptch).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+                                                           "http://localhost:9095/jaxws/add");
+
+        InputStream is = getClass().getResourceAsStream("resources/AddNumbersDispatchReq.xml");
+        SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
+        assertNotNull(soapReqMsg);
+        try {
+            disptch.invoke(soapReqMsg);
+            fail("The MAPcodec ate the SOAPFaultException");
+        } catch (javax.xml.ws.soap.SOAPFaultException e) {
+            //expected
+        }
+    }
 
     private AddNumbersService getService() {
         URL wsdl = getClass().getResource("/wsdl_systest_wsspec/add_numbers.wsdl");

Added: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/resources/AddNumbersDispatchReq.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/resources/AddNumbersDispatchReq.xml?rev=949678&view=auto
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/resources/AddNumbersDispatchReq.xml
(added)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/resources/AddNumbersDispatchReq.xml
Mon May 31 07:30:15 2010
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><addNumbers
xmlns="http://apache.org/cxf/systest/ws/addr_feature/"><number1>-1</number1><number2>-2</number2></addNumbers></soap:Body></soap:Envelope>
\ No newline at end of file



Mime
View raw message