【发布时间】:2012-02-27 15:07:04
【问题描述】:
我正在尝试将一些额外的静态数据添加到入站 http 消息(作为 URL 参数接收)有效负载,然后再将其提交到基于出站 http 表单的端点。我的骡子配置如下:
<flow name="login" doc:name="login">
<http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:8081/login" doc:name="Login"/>
<http:body-to-parameter-map-transformer doc:name="Body to Parameter Map"/>
<http:outbound-endpoint address="http://localhost:8090/mayapp/Main/login.do"
method="POST" contentType="application/x-www-form-urlencoded" exchange-pattern="request-response">
</http:outbound-endpoint>
</flow>
以上将 URL 参数转换为 http 形式的 POST(名称/值对)非常好。我现在需要的是能够将新的名称-值对添加到 POST(ed) 数据中?我要发布的表单需要一些静态数据(作为隐藏的 HTML 字段发布),我希望在转换过程中处理这些数据。
我已经设法使用自定义组件来实现这一点。我想知道是否有更简单的方法来使用 Mule 的本机转换器/消息处理器来处理这个问题!
【问题讨论】: