Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5629

In robust one-way fault the fault message is written twice

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 2.7.11, 3.0
    • None
    • None
    • Unknown

    Description

      I have robust one-way operation. However the resulting soap fault is not written to response, because the output stream is closed, as the same faultObserver is called twice:

      1. in org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(Message):

      boolean isOneWay = false;
      if (message.getExchange() != null) {
          if (message.getContent(Exception.class) != null) {
              message.getExchange().put(Exception.class, ex2);
          }
          isOneWay = message.getExchange().isOneWay() 
              && !MessageUtils.isTrue(message.getContextualProperty(Message.ROBUST_ONEWAY));
      }
      
      if (faultObserver != null && !isOneWay) {
          faultObserver.onMessage(message);
      }
      

      2. later in org.apache.cxf.interceptor.OneWayProcessorInterceptor.handleMessage(Message):

      if (message.getContent(Exception.class) != null) {
          // return the fault over the response fault channel
          MessageObserver faultObserver = chain.getFaultObserver();
          if (faultObserver != null) {
              message.getExchange().setOneWay(false);
              faultObserver.onMessage(message);
          } 
          return;
      }
      

      However, exchage is one-way only in second call, but the soap fault has no change to get to client (output stream is closed).

      I'm working on a patch

      Attachments

        1. CXF-5629.patch
          5 kB
          Grzegorz Grzybek
        2. CXF-5629-2.7.x.patch
          5 kB
          Grzegorz Grzybek

        Activity

          People

            dkulp Daniel Kulp
            ggrzybek Grzegorz Grzybek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: