cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1521905 - in /cxf/trunk/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/ frontend/jaxws/src/tes...
Date Wed, 11 Sep 2013 15:29:08 GMT
Author: dkulp
Date: Wed Sep 11 15:29:08 2013
New Revision: 1521905

URL: http://svn.apache.org/r1521905
Log:
[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/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
    cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java
    cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java?rev=1521905&r1=1521904&r2=1521905&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
Wed Sep 11 15:29: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/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java?rev=1521905&r1=1521904&r2=1521905&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java
Wed Sep 11 15:29: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/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java?rev=1521905&r1=1521904&r2=1521905&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java Wed Sep
11 15:29: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/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java?rev=1521905&r1=1521904&r2=1521905&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java
Wed Sep 11 15:29: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/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java?rev=1521905&r1=1521904&r2=1521905&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java
(original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorImpl.java
Wed Sep 11 15:29:08 2013
@@ -732,14 +732,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/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java?rev=1521905&r1=1521904&r2=1521905&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java
(original)
+++ cxf/trunk/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java
Wed Sep 11 15:29: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) 



Mime
View raw message