Results 1 to 5 of 5

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

  1. #1

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

    Hi,

    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="input.channel" output-channel="ws.input.channel">
    <int:header name="my.header" value="12345"></int:header>
    </int:header-enricher>

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

    <bean id="my.ws.message.sender"
    class="org.springframework.ws.transport.http.Commo 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>
    </property>
    </bean>

    <bean id="wsSecurityInterceptor"
    class="org.springframework.ws.soap.security.xwss.X wsSecurityInterceptor">
    <property name="policyConfiguration" value="classpath:mysecuritypolicy.xml" />
    <property name="callbackHandlers">
    <list>
    <ref bean="mykeyStoreHandler" />
    </list>
    </property>
    </bean>

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

    <int:logging-channel-adapter channel="transformer.channel.out" />

    see the log it returns the null.

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,037

    Default

    Please use [ code ]... [ /code ] tags around code and config.

    see the log it returns the null.
    What log?
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    645

    Default

    Hi!
    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-enricher>
    			<si:header name="my.header" value="12345"/>
    		</si:header-enricher>
    		<ws:outbound-gateway uri="http://test.example.org"
    							 message-sender="mockMessageSender"/>
    		<si:transformer expression="headers['my.header']"/>
    		<si:logging-channel-adapter level="ERROR" />
    	</si:chain>
    Cheers,
    Artem

  4. #4

    Default

    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. #5
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    645

    Default

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •