您提供的XML构成良好或没有验证我们已发布的模式:在从Salesforce致电S3存储桶时
各位,
在进行端到端集成方面,我完全是新手。我正在尝试将我的 salesforce 数据“放入”s3 存储桶,但收到:
您提供的 XML 格式不正确或未根据我们发布的架构进行验证
这就是我正在做的事情:
List<Task> tasks = new List<Task>([SELECT ID from TASK WHERE Id =:recordId LIMIT 1]);
for(Task task:tasks)
{
try
{
//File Content
String Body = JSON.serialize(task);
HttpRequest req = new HttpRequest();
req.setMethod('PUT');
req.setEndpoint('callout:AWS_Credentials');
req.setHeader('Content-Type', 'application/json;charset=UTF-8');
req.setBody(Body);
Http http = new Http();
HTTPResponse res = http.send(req);
我在这里可能做错了什么?太失落了。
提前致谢!
Folks,
A total newbie here when it comes to making end-to-end integrations. I am trying to "put" my salesforce data to the s3 bucket but receiving:
The XML you provided was not well-formed or did not validate against our published schema
Here's what I am doing:
List<Task> tasks = new List<Task>([SELECT ID from TASK WHERE Id =:recordId LIMIT 1]);
for(Task task:tasks)
{
try
{
//File Content
String Body = JSON.serialize(task);
HttpRequest req = new HttpRequest();
req.setMethod('PUT');
req.setEndpoint('callout:AWS_Credentials');
req.setHeader('Content-Type', 'application/json;charset=UTF-8');
req.setBody(Body);
Http http = new Http();
HTTPResponse res = http.send(req);
What might I be doing wrong here? Too lost to see..
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将内容类型设置为' application/xml '而不是'application/json; charset = utf-8'
Set the content type as 'application/xml' instead of 'application/json;charset=UTF-8'