You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mr...@apache.org on 2007/04/06 01:15:00 UTC

svn commit: r526000 - /incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java

Author: mriou
Date: Thu Apr  5 16:15:00 2007
New Revision: 526000

URL: http://svn.apache.org/viewvc?view=rev&rev=526000
Log:
Silly bug.

Modified:
    incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java

Modified: incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java?view=diff&rev=526000&r1=525999&r2=526000
==============================================================================
--- incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java (original)
+++ incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEService.java Thu Apr  5 16:15:00 2007
@@ -144,64 +144,66 @@
             }
         }
 
-        if (odeMex.getOperation() != null) {
-            // Waits for the response to arrive
-            try {
-                responseFuture.get(TIMEOUT, TimeUnit.MILLISECONDS);
-            } catch (Exception e) {
-                String errorMsg = "Timeout or execution error when waiting for response to MEX "
-                        + odeMex + " " + e.toString();
-                __log.error(errorMsg);
-                __log.error(e);
-                throw new OdeFault(errorMsg);
-            }
-
-            if (outMsgContext != null) {
-                SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
-                outMsgContext.setEnvelope(envelope);
-
-                // Hopefully we have a response
-                __log.debug("Handling response for MEX " + odeMex);
-                boolean commit = false;
-                try {
-                    if (__log.isDebugEnabled()) __log.debug("Starting transaction.");
-                    _txManager.begin();
-                } catch (Exception ex) {
-                    throw new OdeFault("Error starting transaction!", ex);
-                }
+        if (odeMex.getOperation().getOutput() != null) {
+            if (odeMex.getOperation() != null) {
+                // Waits for the response to arrive
                 try {
-                    // Refreshing the message exchange
-                    odeMex = (MyRoleMessageExchange) _server.getEngine()
-                            .getMessageExchange(odeMex.getMessageExchangeId());
-                    onResponse(odeMex, outMsgContext);
-                    commit = true;
-                } catch (AxisFault af) {
-                    __log.error("Error processing response for MEX " + odeMex, af);
-                    commit = true;
-                    throw af;
+                    responseFuture.get(TIMEOUT, TimeUnit.MILLISECONDS);
                 } catch (Exception e) {
-                    __log.error("Error processing response for MEX " + odeMex, e);
-                    throw new OdeFault("An exception occured when invoking ODE.", e);
-                } finally {
-                    if (commit)
-                        try {
-                            if (__log.isDebugEnabled()) __log.debug("Comitting transaction.");
-                            _txManager.commit();
-                        } catch (Exception e) {
-                            throw new OdeFault("Commit failed!", e);
-                        }
-                    else
-                        try {
-                            _txManager.rollback();
-                        } catch (Exception ex) {
-                            throw new OdeFault("Rollback failed!", ex);
-                        }
+                    String errorMsg = "Timeout or execution error when waiting for response to MEX "
+                            + odeMex + " " + e.toString();
+                    __log.error(errorMsg);
+                    __log.error(e);
+                    throw new OdeFault(errorMsg);
+                }
+
+                if (outMsgContext != null) {
+                    SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
+                    outMsgContext.setEnvelope(envelope);
+
+                    // Hopefully we have a response
+                    __log.debug("Handling response for MEX " + odeMex);
+                    boolean commit = false;
+                    try {
+                        if (__log.isDebugEnabled()) __log.debug("Starting transaction.");
+                        _txManager.begin();
+                    } catch (Exception ex) {
+                        throw new OdeFault("Error starting transaction!", ex);
+                    }
+                    try {
+                        // Refreshing the message exchange
+                        odeMex = (MyRoleMessageExchange) _server.getEngine()
+                                .getMessageExchange(odeMex.getMessageExchangeId());
+                        onResponse(odeMex, outMsgContext);
+                        commit = true;
+                    } catch (AxisFault af) {
+                        __log.error("Error processing response for MEX " + odeMex, af);
+                        commit = true;
+                        throw af;
+                    } catch (Exception e) {
+                        __log.error("Error processing response for MEX " + odeMex, e);
+                        throw new OdeFault("An exception occured when invoking ODE.", e);
+                    } finally {
+                        if (commit)
+                            try {
+                                if (__log.isDebugEnabled()) __log.debug("Comitting transaction.");
+                                _txManager.commit();
+                            } catch (Exception e) {
+                                throw new OdeFault("Commit failed!", e);
+                            }
+                        else
+                            try {
+                                _txManager.rollback();
+                            } catch (Exception ex) {
+                                throw new OdeFault("Rollback failed!", ex);
+                            }
 
+                    }
                 }
             }
+            if (!success)
+                throw new OdeFault("Message was either unroutable or timed out!");
         }
-        if (!success)
-            throw new OdeFault("Message was either unroutable or timed out!");
     }
 
     public boolean respondsTo(QName serviceName, QName portTypeName) {