Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 49882 invoked from network); 14 Apr 2008 19:30:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Apr 2008 19:30:02 -0000 Received: (qmail 80794 invoked by uid 500); 14 Apr 2008 19:30:03 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 80738 invoked by uid 500); 14 Apr 2008 19:30:03 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 80729 invoked by uid 99); 14 Apr 2008 19:30:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Apr 2008 12:30:03 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Apr 2008 19:29:28 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 76B701A9838; Mon, 14 Apr 2008 12:29:41 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r647955 - in /incubator/cxf/branches/2.0.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ Date: Mon, 14 Apr 2008 19:29:39 -0000 To: cxf-commits@incubator.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080414192941.76B701A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Mon Apr 14 12:29:26 2008 New Revision: 647955 URL: http://svn.apache.org/viewvc?rev=647955&view=rev Log: Merged revisions 647919 via svnmerge from https://svn.apache.org/repos/asf/incubator/cxf/trunk ........ r647919 | dkulp | 2008-04-14 13:43:09 -0400 (Mon, 14 Apr 2008) | 2 lines Remove some dead/unused code. Check to see if we can set oneway on the exchange in the provider case. ........ Removed: incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ProviderInDatabindingInterceptor.java incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ProviderOutDatabindingInterceptor.java Modified: incubator/cxf/branches/2.0.x-fixes/ (props changed) incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java Propchange: incubator/cxf/branches/2.0.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java?rev=647955&r1=647954&r2=647955&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java (original) +++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java Mon Apr 14 12:29:26 2008 @@ -29,10 +29,12 @@ import javax.activation.DataSource; import javax.mail.util.ByteArrayDataSource; +import javax.xml.namespace.QName; import javax.xml.soap.AttachmentPart; import javax.xml.soap.MessageFactory; import javax.xml.soap.MimeHeader; import javax.xml.soap.MimeHeaders; +import javax.xml.soap.SOAPBody; import javax.xml.soap.SOAPConstants; import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPMessage; @@ -74,6 +76,9 @@ import org.apache.cxf.service.model.BindingOperationInfo; import org.apache.cxf.service.model.MessageInfo; import org.apache.cxf.service.model.MessagePartInfo; +import org.apache.cxf.service.model.BindingOperationInfo; +import org.apache.cxf.service.model.OperationInfo; +import org.apache.cxf.service.model.ServiceModelUtil; import org.apache.cxf.staxutils.StaxUtils; public class DispatchInDatabindingInterceptor extends AbstractInDatabindingInterceptor { @@ -176,7 +181,7 @@ } catch (Exception e) { throw new Fault(e); } - } + } private SOAPMessage newSOAPMessage(InputStream is, SoapMessage msg) throws Exception { SoapVersion version = msg.getVersion(); @@ -199,7 +204,44 @@ } return msgFactory.createMessage(headers, is); } - + + void setupBindingOperationInfo(Exchange exch, SOAPMessage msg) { + if (exch.get(BindingOperationInfo.class) == null) { + //need to know the operation to determine if oneway + QName opName = null; + try { + SOAPBody body = msg.getSOAPBody(); + if (body != null) { + org.w3c.dom.Node nd = body.getFirstChild(); + while (nd != null && !(nd instanceof org.w3c.dom.Element)) { + nd = nd.getNextSibling(); + } + if (nd != null) { + opName = new QName(nd.getNamespaceURI(), nd.getLocalName()); + } + } + if (opName == null) { + return; + } + } catch (SOAPException e) { + //ignore and return; + return; + } + BindingOperationInfo bop = ServiceModelUtil + .getOperationForWrapperElement(exch, opName, false); + if (bop == null) { + bop = ServiceModelUtil.getOperation(exch, opName); + } + if (bop != null) { + exch.put(BindingOperationInfo.class, bop); + exch.put(OperationInfo.class, bop.getOperationInfo()); + if (bop.getOutput() == null) { + exch.setOneWay(true); + } + } + + } + } //This interceptor is invoked after DispatchSOAPHandlerInterceptor, converts SOAPMessage to Source private class PostDispatchSOAPHandlerInterceptor extends AbstractInDatabindingInterceptor { @@ -215,7 +257,7 @@ if (message instanceof SoapMessage) { SOAPMessage soapMessage = message.getContent(SOAPMessage.class); message.removeContent(SOAPMessage.class); - + setupBindingOperationInfo(message.getExchange(), soapMessage); DataReader dataReader = new NodeDataReader(); Node n = null; if (mode == Service.Mode.MESSAGE) { @@ -306,6 +348,7 @@ } } obj = msg; + setupBindingOperationInfo(message.getExchange(), msg); } catch (Exception e) { throw new Fault(e); }