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

The message flow is not correct when handler throw ProtocolException outbound

    XMLWordPrintableJSON

    Details

    • Estimated Complexity:
      Unknown

      Description

      The scenario is using two SoapHandler and one LogicalHandler to intercept the message from client, and when LogicalHandler at server side handle the outbound message, it throws a ProtocolException.

      Now, the message flow at server side in CXF is:

      Server_SOAPHandler1_handleMessage_Inbound:
      Server_SOAPHandler2_handleMessage_Inbound:
      Server_LogicalHandler_handleMessage_Inbound:
      Server_countString:
      Server_LogicalHandler_handleMessage_Outbound:
      Server_LogicalHandler_handleFault_Outbound: // All of the three
      Server_SOAPHandler2_handleFault_Outbound: // handlerFault methods
      Server_SOAPHandler1_handleFault_Outbound: // are invoked
      Server_LogicalHandler_close:
      Server_SOAPHandler2_close:
      Server_SOAPHandler1_close:

      But according to jsr224 9.3.2.1

      Throw ProtocolException or a subclass This indicates that normal message processing should cease.
      Subsequent actions depend on whether the MEP in use requires a response to the message currently being processed or not:

      No response Normal message processing stops, close is called on each previously invoked handler in the chain, the exception is dispatched (see section 9.1.2.3).

      I also test the same case in WebSphere8.5 and Glassfish3.1.2.2, the message flow is:
      Server_SOAPHandler1_handleMessage_Inbound:
      Server_SOAPHandler2_handleMessage_Inbound:
      Server_LogicalHandler_handleMessage_Inbound:
      Server_countString:
      Server_LogicalHandler_handleMessage_Outbound:
      Server_LogicalHandler_close:
      Server_SOAPHandler2_close:
      Server_SOAPHandler1_close:

      The handleFault methods are not called, and the close methods are called directly, I think it matches the spec better.

      I also provide a patch for the issue.

        Attachments

        1. cxf-4565.patch
          1 kB
          Yi Xiao

          Activity

            People

            • Assignee:
              ffang Freeman Yue Fang
              Reporter:
              john xiao Yi Xiao
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: