Uploaded image for project: 'FUSE Services Framework'
  1. FUSE Services Framework
  2. SF-317

Returning SOAP headers doesn't work with Faults

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: Major
    • Resolution: Resolved at Apache
    • Affects Version/s: 2.3.1-fuse-01-00
    • Fix Version/s: 2.3.3-fuse-00-00
    • Component/s: None
    • Labels:
      None

      Description

      The solution for returning SOAP header described here: http://cxf.apache.org/faq.html (Question: How can I add soap headers to the request/response?). However it does not work with SOAP faults.

      I'm using binding server (so not @WebServiceProvider but @WebService). Please see attached test case for more details. I believe it's due to below code snippet of JAXWSMethodInvoker.java class:

      try {
                  if ((params == null || params.isEmpty()) && m.getDeclaringClass().equals(Provider.class)) {
                      params = Collections.singletonList(null);
                  }
                  res = CastUtils.cast((List)super.invoke(exchange, serviceObject, m, params));
                  addHandlerProperties(ctx, handlerScopedStuff);
                  //update the webservice response context
                  updateWebServiceContext(exchange, ctx);
              } finally {
                  //clear the WebServiceContextImpl's ThreadLocal variable
                  WebServiceContextImpl.clear();
              }

      As SOAP headers are copied within the function updateWebServiceContext() but it is only called in success scenario and all stuff is cleared in finally block so in case of a fault, the headers are lost.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ffang Freeman(Yue) Fang
                Reporter:
                joe.luo Joe Luo
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: