cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1232515 - in /cxf/branches/2.5.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
Date Tue, 17 Jan 2012 18:08:12 GMT
Author: dkulp
Date: Tue Jan 17 18:08:12 2012
New Revision: 1232515

URL: http://svn.apache.org/viewvc?rev=1232515&view=rev
Log:
Merged revisions 1232497 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1232497 | dkulp | 2012-01-17 12:25:24 -0500 (Tue, 17 Jan 2012) | 2 lines
  
  [CXF-4031] Fix problem with holders required for out params, but
  soap:body is empty on incoming.
........

Modified:
    cxf/branches/2.5.x-fixes/   (props changed)
    cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java

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

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java?rev=1232515&r1=1232514&r2=1232515&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
Tue Jan 17 18:08:12 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,7 +63,8 @@ public class HolderInInterceptor extends
                 .getOutMessage().get(CLIENT_HOLDERS));
             for (MessagePartInfo part : parts) {
                 if (part.getIndex() != 0 && part.getTypeClass() != null) {
-                    Holder holder = (Holder)outHolders.get(part.getIndex() - 1);
+                    @SuppressWarnings("unchecked")
+                    Holder<Object> holder = (Holder<Object>)outHolders.get(part.getIndex()
- 1);
                     if (holder != null) {
                         holder.value = inObjects.get(part);
                         inObjects.put(part, holder);
@@ -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