将Mule 4上传到Salesforce的附件输入示例

时间:2019-04-02 16:26:18

标签: salesforce mule attachment

我想将文件从Mule 4上传到Salesforce附件。我使用了类型为“附件”的创建处理器。创建处理器的附件的输入结构和类型是什么?

在创建之前,我已经尝试了这种转换:

%dw 2.0
output application/java
---
{
    ParentId: payload.TicketAttachmentID,
    Name: "test.bin",
    Body: payload.FileData
}

我希望在Salesforce中上传附件。但是Mule 4在“创建”步骤上返回了错误:

Internal execution exception while executing the script, this is most probably a bug, file an issue with the script and the input data.
Caused by:\njava.nio.charset.UnmappableCharacterException: Input length = 1

1 个答案:

答案 0 :(得分:2)

尝试以下操作:

%dw 2.0
output application/json  <-- this could be the issue
---
{
    ParentId: payload.TicketAttachmentID,
    Name: "test.bin",
    Body: payload.FileData
}