Reputation: 2998
I have a backend process that expects multipart/form-data. I'd like to have mule call it and return the results. Here is a simple flow that I've worked up. However, the outbound-endpoint doesn't transform the message into multipart/form-data. The backend process just gets the body that was initially posted in.
What am I doing wrong?
<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>
Upvotes: 1
Views: 1360
Reputation: 33413
Only messages with attachments are automatically turned into multipart request entities so the best for you would be to:
set-attachment
and set-payload
message processors or a Groovy transformer for that.set-payload
and a #[null]
expression, otherwise it'll be posted a second time in a part named "payload".Upvotes: 2