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

svn commit: r1444973 - in /cxf/branches/2.7.x-fixes: ./ api/src/main/java/org/apache/cxf/interceptor/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ systests/jaxws/src/test/java/org/apache/cxf/systest/provider/

Author: ay
Date: Mon Feb 11 21:36:16 2013
New Revision: 1444973

URL: http://svn.apache.org/r1444973
Log:
Merged revisions 1444251 via  svn merge from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1444251 | ay | 2013-02-08 22:52:55 +0100 (Fri, 08 Feb 2013) | 1 line
  
  [CXF-4812] NPE on MessageModeInInterceptor when sending empty SOAPBody
........

Added:
    cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/NBProviderClientServerTest.java
      - copied unchanged from r1444251, cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/NBProviderClientServerTest.java
    cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/NBSoapMessageDocProvider.java
      - copied unchanged from r1444251, cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/NBSoapMessageDocProvider.java
Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeInInterceptor.java

Propchange: cxf/branches/2.7.x-fixes/
            ('svn:mergeinfo' removed)

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java?rev=1444973&r1=1444972&r2=1444973&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java (original)
+++ cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java Mon Feb 11 21:36:16 2013
@@ -30,6 +30,7 @@ import javax.xml.stream.XMLStreamConstan
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.XMLSchemaQNames;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Exchange;
@@ -148,17 +149,7 @@ public class DocLiteralInInterceptor ext
     
                 if (xmlReader == null || !StaxUtils.toNextElement(xmlReader)) {
                     // empty input
-    
-                    // TO DO : check duplicate operation with no input
-                    for (OperationInfo op : operations) {
-                        MessageInfo bmsg = op.getInput();
-                        if (bmsg.getMessageParts().size() == 0) {
-                            BindingOperationInfo boi = ep.getEndpointInfo().getBinding().getOperation(op);
-                            exchange.put(BindingOperationInfo.class, boi);
-                            exchange.put(OperationInfo.class, op);
-                            exchange.setOneWay(op.isOneWay());
-                        }
-                    }
+                    getBindingOperationForEmptyBody(operations, ep, exchange);
                     return;
                 }
 
@@ -220,6 +211,22 @@ public class DocLiteralInInterceptor ext
         }
     }
 
+    private void getBindingOperationForEmptyBody(Collection<OperationInfo> operations, Endpoint ep, Exchange exchange) {
+        // TO DO : check duplicate operation with no input and also check if the action matches 
+        for (OperationInfo op : operations) {
+            MessageInfo bmsg = op.getInput();
+            List<MessagePartInfo> bparts = bmsg.getMessageParts();
+            if (bparts.size() == 0
+                || (bparts.size() == 1 
+                    && XMLSchemaQNames.XSD_ANY.equals(bparts.get(0).getTypeQName()))) {
+                BindingOperationInfo boi = ep.getEndpointInfo().getBinding().getOperation(op);
+                exchange.put(BindingOperationInfo.class, boi);
+                exchange.put(OperationInfo.class, op);
+                exchange.setOneWay(op.isOneWay());
+            }
+        }
+    }
+
     private BindingOperationInfo getBindingOperationInfo(DepthXMLStreamReader xmlReader, Exchange exchange,
                                                          BindingOperationInfo bop, boolean client) {
         //bop might be a unwrapped, wrap it back so that we can get correct info 

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeInInterceptor.java?rev=1444973&r1=1444972&r2=1444973&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeInInterceptor.java (original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeInInterceptor.java Mon Feb 11 21:36:16 2013
@@ -68,8 +68,8 @@ public class MessageModeInInterceptor ex
     }
 
     public void handleMessage(Message message) throws Fault {
-        if (!bindingName.equals(message.getExchange().get(BindingOperationInfo.class)
-                               .getBinding().getName())) {
+        BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class); 
+        if (bop == null || !bindingName.equals(bop.getBinding().getName())) {
             return;
         }
         Object o = message.getContent(soapMsgClass);