Announcement Announcement Module
Collapse
No announcement yet.
SoapAction lost if a webservice callback is added to a webservice outbound gateway Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SoapAction lost if a webservice callback is added to a webservice outbound gateway

    Hi,

    A soapAction added from a header-enricher is lost if a webservice callback is added to a webservice outbound gateway.

    It would be nice if the soapAction survived the callback if set.

    Example code:

    Code:
    <chain input-channel="inputChannel" output-channel="outputChannel">
    <header-enricher>
    <header name="$ws_soapAction" value="test" />
    </header-enricher>
    
    <si-ws:outbound-gateway uri="..." request-callback="callback" />
    
    </chain>
    
    <bean id="callback" class="CallbackTest" />
    and in CallBackTest

    Code:
    public class CallbackTest implements WebServiceMessageCallback {
    
    public void doWithMessage(WebSeriviceMessage message) {
    
    logger.debug("SoapAction:" + ((SoapMessage)message).getSoapAction()));
    
    }}

    I am using 2.0 M2.

  • #2
    Could you please upgrade to M3 (was released last Friday)
    There was a related issue that was fixed in this release:
    http://jira.springframework.org/browse/INT-1009

    Comment


    • #3
      Originally posted by oleg.zhurakousky View Post
      Could you please upgrade to M3 (was released last Friday)
      There was a related issue that was fixed in this release:
      http://jira.springframework.org/browse/INT-1009
      Hi again,

      Tried with M3, but the SoapAction header is still not propagated to the request callback class.

      Comment


      • #4
        I think what's happening is that the callback you set is overriding/replacing the default callback which checks for the SoapAction header.

        We could probably wrap any callback so that the default behavior is also applied... although there could conceivably be a case where that is not desirable.

        Can you raise an issue for this? If possible, attaching a failing test case would be ideal.

        The workaround would be to create your own callback so that it adds the same logic. Here is the code in question:
        Code:
        private WebServiceMessageCallback getRequestCallback(Message<?> requestMessage) {
            if (this.requestCallback != null) {
                return this.requestCallback;
            }
            String soapAction = requestMessage.getHeaders().get(WebServiceHeaders.SOAP_ACTION, String.class);
            return (soapAction != null) ? new TypeCheckingSoapActionCallback(soapAction) : null;
        }

        Comment


        • #5
          Hi again,

          Raised issue INT-1051 and attached a failing testcase.

          Comment


          • #6
            Thank you! I've set the target to 2.0 M4.

            Comment

            Working...
            X