Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-870

WS-Addressing headers missing from synchronous SOAP responses

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.4
    • Fix Version/s: 2.2.RC1
    • Component/s: Core
    • Labels:
      None

      Description

      WS-Addressing headers are missing from synchonous SOAP responses:
      <env:Header/>

      By debugging Spring-WS, we found that the AddressingEndpointInterceptor inserts the header values correctly in the SOAPMessage, and even the SOAPMessage parameter of the Saaj13Implementation.writeTo() contains the right WS headers. But when message.writeTo(outputStream) is called, the headers are not serialized.

      If in the beginning of the method Saaj13Implementation.writeTo() we call message.saveChanges() without checking message.saveRequired(), the WS-A headers are serialized correctly. We assume that the flag that controls if save is needed might not be correctly set by a previous method.

        Issue Links

          Activity

          Hide
          ibrencsics Ivan Brencsics added a comment -

          No, we dont use Spring Integration.

          Show
          ibrencsics Ivan Brencsics added a comment - No, we dont use Spring Integration.
          Hide
          ibrencsics Ivan Brencsics added a comment -

          I did some investigation, but still confused. The SAAJ MessageImpl.needsSave() method has this comment: "All write methods (i.e setters) should call this method in order to make sure that a save is necessary since the state has been modified".

          The only thing I can imagine is that in some setter in SAAJ the needsMethod() is not called, and finally in the Saaj13Implementation the saveChanges() is not triggered. Maybe it would make sense calling the needsSave() manually as the last step of the interceptors that inject the WSS, WSA headers.

          Show
          ibrencsics Ivan Brencsics added a comment - I did some investigation, but still confused. The SAAJ MessageImpl.needsSave() method has this comment: "All write methods (i.e setters) should call this method in order to make sure that a save is necessary since the state has been modified". The only thing I can imagine is that in some setter in SAAJ the needsMethod() is not called, and finally in the Saaj13Implementation the saveChanges() is not triggered. Maybe it would make sense calling the needsSave() manually as the last step of the interceptors that inject the WSS, WSA headers.
          Hide
          ibrencsics Ivan Brencsics added a comment -

          I can confirm what Matthew wrote. If I set the logging level to TRACE for the org.springframework.ws package, the problem is fixed. In case of TRACE level:
          1) in the log entry the WSA headers are missing (the first call to writeTo() is not correct), but the save flag is configured
          2) but when the Saaj13Implementation calls the writeTo() the second time, the WSA headers are correct on the wire.

          Show
          ibrencsics Ivan Brencsics added a comment - I can confirm what Matthew wrote. If I set the logging level to TRACE for the org.springframework.ws package, the problem is fixed. In case of TRACE level: 1) in the log entry the WSA headers are missing (the first call to writeTo() is not correct), but the save flag is configured 2) but when the Saaj13Implementation calls the writeTo() the second time, the WSA headers are correct on the wire.
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Fixed by calling saveChanges unconditionally now. Thanks for the help, everybody.

          Show
          arjen.poutsma Arjen Poutsma added a comment - Fixed by calling saveChanges unconditionally now. Thanks for the help, everybody.
          Hide
          ibrencsics Ivan Brencsics added a comment -

          Let me just share here that there might be a side effect of this fix:
          https://bugs.eclipse.org/bugs/show_bug.cgi?id=444222
          https://java.net/jira/browse/SAAJ-75

          Show
          ibrencsics Ivan Brencsics added a comment - Let me just share here that there might be a side effect of this fix: https://bugs.eclipse.org/bugs/show_bug.cgi?id=444222 https://java.net/jira/browse/SAAJ-75

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              ibrencsics Ivan Brencsics
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: