cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
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 GMT
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<Node> 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);
                     } 



Mime
View raw message