cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r691304 - in /cxf/branches/2.1.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
Date Tue, 02 Sep 2008 16:24:40 GMT
Author: dkulp
Date: Tue Sep  2 09:24:40 2008
New Revision: 691304

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

........
  r689596 | dkulp | 2008-08-27 15:54:33 -0400 (Wed, 27 Aug 2008) | 2 lines
  
  Fix some tck failures cause by my last commit
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep  2 09:24:40 2008
@@ -1 +1 @@
-/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689855
+/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Sep  2 09:24:40 2008
@@ -1 +1 @@
-/cxf/trunk:1-686342,686344-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689855,690638
+/cxf/trunk:1-686342,686344-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,690638

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java?rev=691304&r1=691303&r2=691304&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
Tue Sep  2 09:24:40 2008
@@ -123,7 +123,7 @@
         if (scopes == null && reqMessage != null) {
             scopes = CastUtils.cast((Map<?, ?>)reqMessage.get(SCOPES));
             m.put(SCOPES, scopes);
-            copyScoped(message);
+            copyScoped(reqMessage);
         }
         if (scopes == null) {
             scopes = new HashMap<String, Scope>();
@@ -206,7 +206,8 @@
                 }
                 ret = createAttachments(getWrappedMessage(), MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
             } else if (MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS.equals(key)) {
-                ret = createAttachments(createResponseMessage(), MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+                ret = createAttachments(isRequestor() ? getWrappedMessage() : createResponseMessage(),
+                    MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
             } else if (MessageContext.MESSAGE_OUTBOUND_PROPERTY.equals(key)) {
                 ret = isOutbound();
             } else if (MessageContext.HTTP_REQUEST_HEADERS.equals(key)) {
@@ -249,19 +250,40 @@
     }
 
     private Message createResponseMessage() {
-        if (exchange == null || isRequestor()) {
+        if (exchange == null || exchange.isOneWay()) {
             return null;
         }
-        Message m = exchange.getOutMessage();
-        if (m == null && !exchange.isOneWay()) {
-            Endpoint ep = exchange.get(Endpoint.class);
-            m = ep.getBinding().createMessage();
-            exchange.setOutMessage(m);
+        if (isResponse()) {
+            return getWrappedMessage();
+        }
+        Message m = null;
+        if (isRequestor()) {
+            m = exchange.getInFaultMessage();
+            if (m == null) {
+                m = exchange.getInMessage();
+            }
+            if (m == null) {
+                Endpoint ep = exchange.get(Endpoint.class);
+                m = ep.getBinding().createMessage();
+                exchange.setInMessage(m);
+            }
+        } else {
+            m = exchange.getOutMessage();
+            if (m == null) {
+                m = exchange.getOutFaultMessage();
+            }
+            if (m == null) {
+                Endpoint ep = exchange.get(Endpoint.class);
+                m = ep.getBinding().createMessage();
+                exchange.setOutMessage(m);
+            }
         }
         return m;
     }
     private Object createAttachments(Message mc, String propertyName) {
-
+        if (mc == null) {
+            return null;
+        }
         Collection<Attachment> attachments = mc.getAttachments();
         Map<String, DataHandler> dataHandlers = getDHMap(attachments);
         mc.put(propertyName, 



Mime
View raw message