You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2013/09/11 17:32:08 UTC

svn commit: r1521906 - in /cxf/branches/2.7.x-fixes/rt: bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/ frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ fronten...

Author: dkulp
Date: Wed Sep 11 15:32:08 2013
New Revision: 1521906

URL: http://svn.apache.org/r1521906
Log:
Merged revisions 1521905 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1521905 | dkulp | 2013-09-11 11:29:08 -0400 (Wed, 11 Sep 2013) | 3 lines

  [CXF-5268] If we've determined the proper operation out of the WSDL, go ahead an use it.
  This removes a bunch of hacks that were scattered in the soap binding and ws-addressing impl.

........

Modified:
    cxf/branches/2.7.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
    cxf/branches/2.7.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java
    cxf/branches/2.7.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java
    cxf/branches/2.7.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java

Modified: cxf/branches/2.7.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java?rev=1521906&r1=1521905&r2=1521906&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java (original)
+++ cxf/branches/2.7.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java Wed Sep 11 15:32:08 2013
@@ -141,11 +141,6 @@ public class SoapPreProtocolOutIntercept
             if (boi == null) {
                 action = "\"\"";
             } else {
-                BindingOperationInfo dboi = 
-                    (BindingOperationInfo)boi.getProperty("dispatchToOperation");
-                if (null != dboi) {
-                    boi = dboi;
-                }
                 SoapOperationInfo soi = boi.getExtensor(SoapOperationInfo.class);
                 action = soi == null ? "\"\"" : soi.getAction() == null ? "\"\"" : soi.getAction();
             }

Modified: cxf/branches/2.7.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java?rev=1521906&r1=1521905&r2=1521906&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java (original)
+++ cxf/branches/2.7.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java Wed Sep 11 15:32:08 2013
@@ -71,31 +71,6 @@ public class SoapPreProtocolOutIntercept
         assertEquals("\"http://foo/bar/SEI/opReq\"", soapaction.get(0));
     }
 
-    @Test
-    public void testRequestorOutboundDispatchedSoapAction() throws Exception {
-        SoapMessage message = setUpMessage();
-        BindingOperationInfo dbop = setUpBindingOperationInfo("http://foo/bar/d",
-                                                              "opDReq",
-                                                              "opDResp",
-                                                              SEI.class.getMethod("op", new Class[0]));
-        SoapOperationInfo soi = new SoapOperationInfo();
-        soi.setAction("http://foo/bar/d/SEI/opDReq");
-        dbop.addExtensor(soi);
-
-        BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);
-        bop.setProperty("dispatchToOperation", dbop);
-
-        interceptor.handleMessage(message);
-        control.verify();
-
-        Map<String, List<String>> reqHeaders 
-            = CastUtils.cast((Map<?, ?>)message.get(Message.PROTOCOL_HEADERS));
-        assertNotNull(reqHeaders);
-        List<String> soapaction = reqHeaders.get("soapaction");
-        assertTrue(null != soapaction && soapaction.size() == 1);
-        assertEquals("\"http://foo/bar/d/SEI/opDReq\"", soapaction.get(0));
-    }
-
     private SoapMessage setUpMessage() throws Exception {
         
         SoapMessage message = new SoapMessage(new MessageImpl());

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java?rev=1521906&r1=1521905&r2=1521906&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java (original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java Wed Sep 11 15:32:08 2013
@@ -369,19 +369,15 @@ public class DispatchImpl<T> implements 
                 if (payloadElementName != null) {
                     QName dispatchedOpName = payloadOPMap.get(payloadElementName);
                     if (null != dispatchedOpName) {
-                        BindingOperationInfo bop = client.getEndpoint().getBinding().getBindingInfo()
-                          .getOperation(opName);
                         BindingOperationInfo dbop = client.getEndpoint().getBinding().getBindingInfo()
-                          .getOperation(dispatchedOpName);
-                        if (bop != null) {
-                            // set the actual binding operation object to this dispatch operation
-                            bop.setProperty("dispatchToOperation", dbop);
+                            .getOperation(dispatchedOpName);
+                        if (dbop != null) {
+                            opName = dispatchedOpName;
                         }
                     }
                 }
             } 
             
-            
             Object ret[] = client.invokeWrapped(opName,
                                                 createdSource == null ? obj : createdSource);
             if (isOneWay || ret == null || ret.length == 0) {

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java?rev=1521906&r1=1521905&r2=1521906&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java (original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java Wed Sep 11 15:32:08 2013
@@ -191,10 +191,8 @@ public class DispatchTest extends Abstra
 
         BindingOperationInfo boi = bov.getBindingOperationInfo();
         assertNotNull(boi);
-        BindingOperationInfo dboi = (BindingOperationInfo)boi.getProperty("dispatchToOperation");
-        assertNotNull(dboi);
 
-        assertEquals(new QName("http://apache.org/hello_world_soap_http", "sayHi"), dboi.getName());
+        assertEquals(new QName("http://apache.org/hello_world_soap_http", "sayHi"), boi.getName());
     }
     
     private static class BindingOperationVerifier extends AbstractSoapInterceptor {

Modified: cxf/branches/2.7.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java?rev=1521906&r1=1521905&r2=1521906&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java (original)
+++ cxf/branches/2.7.x-fixes/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java Wed Sep 11 15:32:08 2013
@@ -733,14 +733,6 @@ public class MAPAggregatorImpl extends M
         if (op.isUnwrapped()) {
             op = ((UnwrappedOperationInfo)op).getWrappedOperation();
         }
-        //CXF-2836:To correct the wsa:action header value for dispatch client
-        BindingOperationInfo dbop = (BindingOperationInfo)bop.getProperty("dispatchToOperation");
-        if (null != dbop) {
-            //modifies the bop and bp to the value of dispatch client really invokes, 
-            //This helps corrct the wsa:action header value
-            bop = dbop;
-            op = dbop.getOperationInfo();
-        }
         
         String actionUri = null;
         if (checkMessage) {

Modified: cxf/branches/2.7.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java?rev=1521906&r1=1521905&r2=1521906&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java (original)
+++ cxf/branches/2.7.x-fixes/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java Wed Sep 11 15:32:08 2013
@@ -448,23 +448,6 @@ public class MAPAggregatorTest extends A
         assertEquals("http://foo/bar/SEI/opRequest", action);
     }
     
-    @Test
-    public void testGetActionUriForDispatchOp() throws Exception {
-        Message message = setUpMessage(true, true, false, true, true);
-        BindingOperationInfo dbop = setUpBindingOperationInfo("http://foo/bar/d",
-                                                              "opDRequest",
-                                                              "opDResponse",
-                                                              "opDFault", 
-                                                              DSEI.class.getMethod("op", new Class[0]));
-
-        BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);
-        bop.setProperty("dispatchToOperation", dbop);
-
-        String action = aggregator.getActionUri(message, false);
-        control.verify();
-        assertEquals("http://foo/bar/d/DSEI/opDRequest", action);
-    }
-
     private Message setUpMessage(boolean requestor, 
                                  boolean outbound,
                                  boolean oneway)