Author: ay Date: Mon Feb 11 22:45:34 2013 New Revision: 1444988 URL: http://svn.apache.org/r1444988 Log: Merged revisions 1444973 via svn merge from https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes
........ r1444973 | ay | 2013-02-11 22:36:16 +0100 (Mon, 11 Feb 2013) | 9 lines 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.6.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/NBProviderClientServerTest.java - copied unchanged from r1444973, cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/NBProviderClientServerTest.java cxf/branches/2.6.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/NBSoapMessageDocProvider.java - copied unchanged from r1444973, cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/NBSoapMessageDocProvider.java Modified: cxf/branches/2.6.x-fixes/ (props changed) cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeInInterceptor.java Propchange: cxf/branches/2.6.x-fixes/ ('svn:mergeinfo' removed) Propchange: cxf/branches/2.6.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java?rev=1444988&r1=1444987&r2=1444988&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java (original) +++ cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java Mon Feb 11 22:45:34 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; @@ -155,17 +156,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; } @@ -224,7 +215,23 @@ public class DocLiteralInInterceptor ext throw f; } } - + + 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 void validatePart(MessagePartInfo p, QName elName, Message m) { if (p == null) { throw new Fault(new org.apache.cxf.common.i18n.Message("NO_PART_FOUND", LOG, elName), Modified: cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeInInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeInInterceptor.java?rev=1444988&r1=1444987&r2=1444988&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeInInterceptor.java (original) +++ cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeInInterceptor.java Mon Feb 11 22:45:34 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);
