让mule调用需要多部分/表单数据的http进程
我有一个需要多部分/表单数据的后端进程。我想让mule调用它并返回结果。这是一个我设计的简单流程。但是,出站端点不会将消息转换为多部分/表单数据。后端进程只获取最初发布的主体 我做错了什么让mule调用需要多部分/表单数据的http进程,mule,Mule,我有一个需要多部分/表单数据的后端进程。我想让mule调用它并返回结果。这是一个我设计的简单流程。但是,出站端点不会将消息转换为多部分/表单数据。后端进程只获取最初发布的主体 我做错了什么 <flow name="testFlow"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" mimeType="text/plain" contentTy
<flow name="testFlow">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" mimeType="text/plain" contentType="text/plain" />
<message-properties-transformer>
<add-message-property key="f" value="#[payload:java.lang.String]"/>
</message-properties-transformer>
<http:outbound-endpoint exchange-pattern="request-response" host="x12backend" port="9877" path="dummy.php" contentType="multipart/form-data"/>
</flow>
只有带有附件的邮件才会自动转换为多部分请求实体,因此您最好:
- 将消息有效负载移动到出站附件:附件名称将用于部件名称。使用
和设置附件
消息处理器或Groovy transformer设置有效负载
- 将消息payload设置为org.mule.transport.NullPayload(使用
和Set payload
表达式,否则它将在名为“payload”的部分中再次发布#[null]