Reputation: 31
We have a asp page which reading some information form request like this:
varLogon = Request.ServerVariables("HTTP_logon")
If we want to post something to the asp page using spring integration, we are unable to pass the HTTP_logon
to the page,
This is not working
Any idea, what and how we can set the request header information?
<int:header-enricher input-channel="pdfgenheaderchannel" output-channel="pdfgenchannel">
<int:header name="HTTP_ordernumber" method="getOrdernumber" ref="reportbean"/>
<int:header name="reportID" method="getReportID" ref="reportbean"/>
<int:header name="Content-Type" value="text/html"/>
<int:header name="logon" value="orderADCB"/>
<int:header name="HTTP_logon" value="orderADCB"/>
</int:header-enricher>
<int-http:outbound-gateway id="pdfgenerationoutboundgateway"
request-channel="pdfgenchannel"
url="http://x.xy.xx.y/convertHTMLtoPDF.asp"
http-method="POST"
expected-response-type="java.lang.String"
charset="UTF-8"
reply-channel="replyChannel"
request-factory="requestFactory" />
Upvotes: 3
Views: 1345
Reputation: 752
You can user following routing component to route according to header values.
<int:header-value-router input-channel="routingChannel" header-name="headerObject">
<int:mapping value="value1" channel="channel1" />
<int:mapping value="calue2" channel="channel2" />
</int:header-value-router>
Upvotes: 0
Reputation: 121177
You have to specify a header-mapper
for the <int-http:outbound-gateway>
. By default it maps only standard HTTP headers:
<beans:bean id="headerMapper" class="org.springframework.integration.http.support.DefaultHttpHeaderMapper"
factory-method="outboundMapper">
<beans:property name="outboundHeaderNames" value="*"/>
<beans:property name="userDefinedHeaderPrefix" value=""/>
</beans:bean>
<int-http:outbound-gateway header-mapper="headerMapper"/>
Upvotes: 2