cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1232497 - /cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
Date Tue, 17 Jan 2012 17:25:24 GMT
Author: dkulp
Date: Tue Jan 17 17:25:24 2012
New Revision: 1232497

URL: http://svn.apache.org/viewvc?rev=1232497&view=rev
Log:
[CXF-4031] Fix problem with holders required for out params, but
soap:body is empty on incoming.

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java?rev=1232497&r1=1232496&r2=1232497&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
Tue Jan 17 17:25:24 2012
@@ -42,7 +42,6 @@ public class HolderInInterceptor extends
         super(Phase.PRE_INVOKE);
     }
 
-    @SuppressWarnings("unchecked")
     public void handleMessage(Message message) throws Fault {
         MessageContentsList inObjects = MessageContentsList.getContentsList(message);
 
@@ -64,6 +63,7 @@ public class HolderInInterceptor extends
                 .getOutMessage().get(CLIENT_HOLDERS));
             for (MessagePartInfo part : parts) {
                 if (part.getIndex() != 0 && part.getTypeClass() != null) {
+                    @SuppressWarnings("unchecked")
                     Holder<Object> holder = (Holder<Object>)outHolders.get(part.getIndex()
- 1);
                     if (holder != null) {
                         holder.value = inObjects.get(part);
@@ -75,6 +75,13 @@ public class HolderInInterceptor extends
             for (MessagePartInfo part : parts) {
                 int idx = part.getIndex() - 1;
                 if (idx >= 0 && part.getTypeClass() != null) {
+                    if (inObjects == null) {
+                        //if soap:body is empty, the contents may not exist
+                        //so we need to create a contents list to store
+                        //the holders for the outgoing parts (CXF-4031)
+                        inObjects = new MessageContentsList();
+                        message.setContent(List.class, inObjects);
+                    }
                     if (idx >= inObjects.size()) {
                         inObjects.set(idx, new Holder<Object>());
                     } else {



Mime
View raw message