You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2012/01/17 19:16:53 UTC
svn commit: r1232520 - in /cxf/branches/2.4.x-fixes: ./
rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
Author: dkulp
Date: Tue Jan 17 18:16:52 2012
New Revision: 1232520
URL: http://svn.apache.org/viewvc?rev=1232520&view=rev
Log:
Merged revisions 1232515 via svnmerge from
https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes
................
r1232515 | dkulp | 2012-01-17 13:08:12 -0500 (Tue, 17 Jan 2012) | 10 lines
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.4.x-fixes/ (props changed)
cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java?rev=1232520&r1=1232519&r2=1232520&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java (original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java Tue Jan 17 18:16:52 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 {