diff --git a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java index 799c26e0593..1cd330a8be9 100644 --- a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java +++ b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java @@ -657,24 +657,9 @@ protected Object[] processResult(Message message, if (ex != null) { throw ex; } - - if (resList == null - && oi != null && !oi.getOperationInfo().isOneWay()) { - - BindingOperationInfo boi = oi; - if (boi.isUnwrapped()) { - boi = boi.getWrappedOperation(); - } - if (!boi.getOutput().getMessageParts().isEmpty()) { - //we were supposed to get some output, but didn't - throw new IllegalStateException("Response message did not contain proper response data. Expected: " - + boi.getOutput().getMessageParts().get(0).getConcreteName()); - } - } if (resList != null) { return resList.toArray(); } - return null; } protected Exception getException(Exchange exchange) { diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java index 5048af1818c..d89be942a84 100644 --- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java +++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java @@ -138,6 +138,10 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl } else { result = invokeSync(method, oi, params); } + if (result == null && !method.getReturnType().equals(Void.TYPE) + && method.getReturnType().isPrimitive()) { + throw new IllegalStateException("Response message did not contain proper response data"); + } } catch (WebServiceException wex) { throw wex; } catch (Exception ex) { diff --git a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java index d0670ca4031..2fb7bb65e47 100644 --- a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java +++ b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxy.java @@ -79,6 +79,9 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl } Object o = invokeSync(method, oi, params); + if (o == null && !method.getReturnType().equals(Void.TYPE) && method.getReturnType().isPrimitive()) { + throw new IllegalStateException("Response message did not contain proper response data"); + } //call a virtual method passing the object. This causes the IBM JDK //to keep the "this" pointer references and thus "this" doesn't get //finalized in the midst of an invoke operation