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

Custom HTTP headers ignored in service responses when using MTOM with JAX-WS and JAXB

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.1.8
    • None
    • Transports
    • None
    • Unknown

    Description

      I have set up a CXF server endpoint (v. 3.1.8) using JAX-WS with JAXB databinding and MTOM. Everything else works correctly but the custom HTTP headers that I add with an outbound interceptor to the response messages seem to disappear. The custom headers are in place for other than MTOM-enabled endpoint responses. I have followed the guidance (1) in my interceptor which adds the headers ("prior to WRITE phase").

      I suspect the problem is in AttachmentOutInterceptor (2) as it does not respect the headers possibly specified by other interceptors ("root headers" are always empty)? I guess the "root headers" should be initialized from the current message state.

      I also tried (against the mentioned guidance) adding my interceptor after AttachmentOutInterceptor (and also after AttachmentOutInterceptor#AttachmentOutEndingInterceptor) but it did not help.

      1) https://issues.apache.org/jira/browse/CXF-5573?focusedCommentId=13907135&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13907135
      2) https://github.com/apache/cxf/blob/cxf-3.1.8/core/src/main/java/org/apache/cxf/interceptor/AttachmentOutInterceptor.java#L96

      Attachments

        Activity

          People

            Unassigned Unassigned
            hamapa Panu Hämäläinen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: