servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r515265 - /incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181ExchangeProcessor.java
Date Tue, 06 Mar 2007 19:32:21 GMT
Author: gnodet
Date: Tue Mar  6 11:32:20 2007
New Revision: 515265

URL: http://svn.apache.org/viewvc?view=rev&rev=515265
Log:
SM-867: Cannot add soap headers in JSR181 component

Modified:
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181ExchangeProcessor.java

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181ExchangeProcessor.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181ExchangeProcessor.java?view=diff&rev=515265&r1=515264&r2=515265
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181ExchangeProcessor.java
(original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181ExchangeProcessor.java
Tue Mar  6 11:32:20 2007
@@ -106,6 +106,9 @@
             msg.setAttachments(attachments);
         }
         JBIContext.setMessageExchange(exchange);
+        if (isInAndOut(exchange)) {
+            
+        }
         try {
             c.receive(ctx, msg);
         } finally {
@@ -117,17 +120,24 @@
         if (isInAndOut(exchange)) {
             if (ctx.getExchange().hasFaultMessage() && ctx.getExchange().getFaultMessage().getBody()
!= null) {
                 String charSet = ctx.getExchange().getFaultMessage().getEncoding();
-                Fault fault = exchange.createFault();
+                Fault fault = exchange.getFault();
+                if (fault == null) {
+                    fault = exchange.createFault();
+                    exchange.setFault(fault);
+                }
                 fault.setContent(new StringSource(out.toString(charSet)));
                 XFireFault xFault = (XFireFault) ctx.getExchange().getFaultMessage().getBody();
                 fault.setProperty(SOAP_FAULT_CODE, xFault.getFaultCode());
                 fault.setProperty(SOAP_FAULT_REASON, xFault.getReason());
                 fault.setProperty(SOAP_FAULT_ROLE, xFault.getRole());
                 fault.setProperty(SOAP_FAULT_SUBCODE, xFault.getSubCode());
-                exchange.setFault(fault);
             } else {
                 String charSet = ctx.getOutMessage().getEncoding();
-                NormalizedMessage outMsg = exchange.createMessage();
+                NormalizedMessage outMsg = exchange.getMessage("out");
+                if (outMsg == null) {
+                    outMsg = exchange.createMessage();
+                    exchange.setMessage(outMsg, "out");
+                }
                 Attachments attachments = ctx.getCurrentMessage().getAttachments();
                 if (attachments != null) {
                     for (Iterator it = attachments.getParts(); it.hasNext();) {
@@ -136,7 +146,6 @@
                     }
                 }
                 outMsg.setContent(new StringSource(out.toString(charSet)));
-                exchange.setMessage(outMsg, "out");
             }
             if (exchange.isTransacted() && Boolean.TRUE.equals(exchange.getProperty(JbiConstants.SEND_SYNC)))
{
                 channel.sendSync(exchange);



Mime
View raw message