title: Spring Integration - how to keep the orginal payload and use it later?
body: <p>I would like to keep the original payload of the original requests and ise it in a xslt-transformer or in other operation. I lose it because I use an xslt-transformer and I need just some of the elements in the transformation. So my scenario is:</p>
  
  <p>1.inbound-gateway (incoming WS req) -> 2.xslt-transformer (mapping for calling an external WS) -> 3.outbound-gateway (calling the external WS) -> 4.xslt-transformer (creating response from the resp. of the external WS and the original req)</p>
  
  <p>At the 4th step I don't have the original req but I'd need it as I have to put values from it to the response. How could I implement it?</p>
  
  <p>Thanks,
  V.</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration" xmlns:int-ws="http://www.springframework.org/schema/integration/ws" xmlns:int-xml="http://www.springframework.org/schema/integration/xml" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/integration/ws http://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd                        http://www.springframework.org/schema/integration/xml http://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"&gt;
  
  &lt;bean id="authenticator" class="uk.co.virginmedia.test.Authenticator"/&gt;
  &lt;bean id="webserviceDestinationProvider" class="uk.co.virginmedia.test.WebserviceDestinationProvider"/&gt;
  &lt;bean id="resultToDocumentTransformer" class="org.springframework.integration.xml.transformer.ResultToDocumentTransformer"/&gt;
  
  &lt;util:map id="orderNamespaceMap"&gt;
      &lt;entry key="res" value="http://schema/ReserveAppointment/2/0" /&gt;
  &lt;/util:map&gt;
  
  &lt;int-ws:inbound-gateway id="ws-gateway-for-rbta" request-channel="incoming-req-channel" reply-channel=""/&gt;
  
  &lt;int:channel id="incoming-req-channel"/&gt;
  
  &lt;int:service-activator id="authentication" input-channel="incoming-req-channel" ref="authenticator" method="authenticate" output-channel="authenticated-channel" /&gt;
  
  &lt;int:channel id="authenticated-channel"/&gt;
  
  &lt;int-xml:xpath-router id="servicetype-router" input-channel="authenticated-channel" evaluate-as-string="true"&gt;
      &lt;int-xml:xpath-expression expression="//res:ReserveAppointmentRequest/res:serviceType/text()" ns-prefix="res" ns-uri="http://schema/ReserveAppointment/2/0"/&gt;
      &lt;int-xml:mapping value="Broadband" channel="broadband-channel"/&gt;
      &lt;int-xml:mapping value="FTTC+WholesaleLineRental" channel="fttc-wlr-channel"/&gt;
  &lt;/int-xml:xpath-router&gt;
  
  &lt;int:channel id="broadband-channel"/&gt;
  
  &lt;int-xml:xslt-transformer id="req_for_bt_xslt_transformer" input-channel="broadband-channel" output-channel="domresult_for_bt_channel" xsl-resource="classpath:/xsl/ToBTReq.xsl" result-type="StringResult"/&gt;
  
  &lt;int:channel id="domresult_for_bt_channel"/&gt;
  
  &lt;int:transformer input-channel="domresult_for_bt_channel" output-channel="document_for_bt_channel" expression="payload.toString()"/&gt;
  
  &lt;int:channel id="document_for_bt_channel"/&gt;
  
  &lt;int-ws:outbound-gateway request-channel="document_for_bt_channel" reply-channel="resp_from_bt_channel" destination-provider="webserviceDestinationProvider" id="call_bt-outbound_gateway" /&gt;
  
  &lt;int:channel id="resp_from_bt_channel"/&gt;
  
  &lt;int-xml:xslt-transformer id="resp_for_rbta_xslt_transformer" input-channel="resp_from_bt_channel" output-channel="resp_for_rbta_channel" xsl-resource="classpath:/xsl/ToBTReq.xsl" result-type="StringResult"/&gt;
  </code></pre>
  
  <p></p>