Announcement Announcement Module
No announcement yet.
Header values are wiped out after the int-ws:outbound-gateway response Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Header values are wiped out after the int-ws:outbound-gateway response


    My use case: I am calling a webservice using int-ws:outbound-gateway, which uses the interceptor to encrypt the request payload before posting to server, when the response returned by gateway in reply channel i don't see the header value, which i have set before calling the gateway.

    Ideally it should be present once the control comes back to reply channel.

    code snippet.

    <int:header-enricher input-channel="" output-channel="">
    <int:header name="my.header" value="12345"></int:header>

    <int-ws:outbound-gateway id=""
    request-channel="" reply-channel=""
    ignore-empty-responses="true" message-sender=""
    interceptors="wsSecurityInterceptor" uri="http://localhost:8080/my-context/my-endpoint">

    <bean id=""
    class=" nsHttpMessageSender">
    <property name="readTimeout" value="1200" />
    <property name="credentials">
    <bean class="org.apache.commons.httpclient.UsernamePassw ordCredentials">
    <constructor-arg index="0" value="myusername" />
    <constructor-arg index="1" value="mypassword" />

    <bean id="wsSecurityInterceptor"
    class=" wsSecurityInterceptor">
    <property name="policyConfiguration" value="classpath:mysecuritypolicy.xml" />
    <property name="callbackHandlers">
    <ref bean="mykeyStoreHandler" />

    <int:transfermor input-channel="" output-channel="" expression="headers['my.header']"/>

    <int:logging-channel-adapter channel="" />

    see the log it returns the null.

  • #2
    Please use [ code ]... [ /code ] tags around code and config.

    see the log it returns the null.
    What log?


    • #3
      I'm not sure what's going on, but I see you have wrong tag name: transfermor:
      Nevertheless I've tried your use-case and it works perfectly:
      HTML Code:
      	<si:chain input-channel="wsOutboundGatewayInsideChain">
      			<si:header name="my.header" value="12345"/>
      		<ws:outbound-gateway uri=""
      		<si:transformer expression="headers['my.header']"/>
      		<si:logging-channel-adapter level="ERROR" />


      • #4
        Hi Thank you,
        the transfermor was typo error.

        My use case contains int-ws:outbound-gateway which calls service exposed using the int-http:inbound-gateway in same application.

        Before calling the int-ws:outbound-gateway i have set some header value, expected is the header should be available in int-ws:outbound-gateway response channel as well.

        But it is not available,


        • #5
          I recommend you to debug AbstractWebServiceOutboundGateway#handleRequestMes sage and go ahead to the AbstractReplyProducingMessageHandler#handleMessage Internal and observe if requestMessage really has your header.

          And also: which version of Spring Integration do you use? Can you wshich to the latest 2.2.GA?