You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2017/02/17 04:28:08 UTC

cxf git commit: [CXF-7240]JAX-WS Dispatch incorrectly asserts that Message mode with XML/HTTP binding is invalid when using instances of DataSource

Repository: cxf
Updated Branches:
  refs/heads/master 146b00d19 -> 9596758eb


[CXF-7240]JAX-WS Dispatch incorrectly asserts that Message mode with XML/HTTP binding is invalid when using instances of DataSource


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/9596758e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/9596758e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/9596758e

Branch: refs/heads/master
Commit: 9596758ebbaa4e703307394a19bb6d2a411647b9
Parents: 146b00d
Author: Freeman Fang <fr...@gmail.com>
Authored: Fri Feb 17 12:27:55 2017 +0800
Committer: Freeman Fang <fr...@gmail.com>
Committed: Fri Feb 17 12:27:55 2017 +0800

----------------------------------------------------------------------
 .../java/org/apache/cxf/jaxws/DispatchImpl.java |  8 +-------
 .../handlers/DispatchHandlerInvocationTest.java | 20 +++++---------------
 2 files changed, 6 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/9596758e/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
index da2fa16..2e36c08 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
@@ -148,13 +148,7 @@ public class DispatchImpl<T> implements Dispatch<T>, BindingProvider, Closeable
                                 "SOAPMessage",
                                 m,
                                 "SOAP/HTTP");
-        } else if (DataSource.class.isAssignableFrom(clazz)
-            && binding instanceof HTTPBinding) {
-            error = new Message("DISPATCH_OBJECT_NOT_SUPPORTED", LOG,
-                                "DataSource",
-                                m,
-                                "XML/HTTP");
-        }
+        } 
     }
 
     DispatchImpl(Client cl, Service.Mode m, Class<T> clazz) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/9596758e/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java
index a6df9a0..19e93c1 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java
@@ -49,9 +49,9 @@ import javax.xml.ws.handler.LogicalMessageContext;
 import javax.xml.ws.handler.MessageContext;
 import javax.xml.ws.handler.soap.SOAPHandler;
 import javax.xml.ws.handler.soap.SOAPMessageContext;
-import javax.xml.ws.http.HTTPException;
 import javax.xml.ws.soap.SOAPFaultException;
 
+
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.testutil.common.TestUtil;
 import org.apache.handlers.AddNumbersService;
@@ -305,12 +305,8 @@ public class DispatchHandlerInvocationTest extends AbstractBusClientServerTestBa
         URL is = getClass().getResource("/messages/XML_GreetMeDocLiteralReq.xml");
         DataSource ds = new URLDataSource(is);
 
-        try {
-            disp.invoke(ds);
-            fail("Did not get expected exception");
-        } catch (HTTPException e) {
-            //expected
-        }
+        DataSource resp = disp.invoke(ds);
+        assertNotNull(resp);
     }
 
     @Test
@@ -329,14 +325,8 @@ public class DispatchHandlerInvocationTest extends AbstractBusClientServerTestBa
 
         URL is = getClass().getResource("/messages/XML_GreetMeDocLiteralReq.xml");
         DataSource ds = new URLDataSource(is);
-
-        try {
-            disp.invoke(ds);
-            fail("Did not get expected exception");
-        } catch (HTTPException e) {
-            assertEquals(e.getCause().getMessage(),
-                         "DataSource is not valid in PAYLOAD mode with XML/HTTP binding.");
-        }
+        DataSource resp = disp.invoke(ds);
+        assertNotNull(resp);
     }
 
     @Test