Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-462

AbstractInOutAsyncMessageReceiver : in method invokeBusinessLogic, wrong parameter for engine.send(...)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 0.93, 0.94
    • 0.95
    • kernel
    • None
    • All operating systems/plateforms

    Description

      In the invokeBusinessLogic method, and particulary in the handleResult() method, when calling the engine.send(..) method, the incoming MessageContext is send (messageCtx) rather than result one (result).

      Here after the fixed source code :

      public abstract class AbstractInOutAsyncMessageReceiver extends AbstractMessageReceiver {
      protected Log log = LogFactory.getLog(getClass());

      public abstract void invokeBusinessLogic(MessageContext inMessage, MessageContext outMessage,
      ServerCallback callback)
      throws AxisFault;

      public final void receive(final MessageContext messageCtx) throws AxisFault {
      final ServerCallback callback = new ServerCallback() {
      public void handleResult(MessageContext result) throws AxisFault

      { AxisEngine engine = new AxisEngine(messageCtx.getOperationContext().getServiceContext() .getConfigurationContext()); // BUG //engine.send(messageCtx); // FIXED engine.send(result); }

      public void handleFault(AxisFault fault) throws AxisFault

      { AxisEngine engine = new AxisEngine(messageCtx.getOperationContext().getServiceContext() .getConfigurationContext()); MessageContext faultContext = engine.createFaultMessageContext(messageCtx, fault); engine.sendFault(faultContext); }

      };
      Runnable theadedTask = new Runnable() {
      public void run() {
      try

      { MessageContext newmsgCtx = Utils.createOutMessageContext(messageCtx); newmsgCtx.getOperationContext().addMessageContext(newmsgCtx); invokeBusinessLogic(messageCtx, newmsgCtx, callback); }

      catch (AxisFault e)

      { log.error(e); }

      }
      };

      messageCtx.getConfigurationContext().getThreadPool().execute(theadedTask);
      }
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            jsricard Jean-Sébastien Ricard
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: