You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/01/11 14:02:19 UTC
svn commit: r368020 -
/incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpInOutBinding.java
Author: gnodet
Date: Wed Jan 11 05:02:16 2006
New Revision: 368020
URL: http://svn.apache.org/viewcvs?rev=368020&view=rev
Log:
Check exchange status in HttpInOutBinding
Modified:
incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpInOutBinding.java
Modified: incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpInOutBinding.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpInOutBinding.java?rev=368020&r1=368019&r2=368020&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpInOutBinding.java (original)
+++ incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpInOutBinding.java Wed Jan 11 05:02:16 2006
@@ -16,6 +16,7 @@
package org.apache.servicemix.components.http;
import javax.jbi.JBIException;
+import javax.jbi.messaging.ExchangeStatus;
import javax.jbi.messaging.InOnly;
import javax.jbi.messaging.InOut;
import javax.jbi.messaging.MessageExchangeFactory;
@@ -57,6 +58,13 @@
exchange.setInMessage(inMessage);
boolean result = getDeliveryChannel().sendSync(exchange);
if (result) {
+ if (exchange.getStatus() == ExchangeStatus.ERROR) {
+ if (exchange.getError() != null) {
+ throw new ServletException(exchange.getError());
+ } else {
+ throw new ServletException("Exchange status is ERROR");
+ }
+ }
getMarshaler().toResponse(exchange, exchange.getOutMessage(), response);
}
done(exchange);