大佬教程收集整理的这篇文章主要介绍了SSIS 脚本任务中的 Salesforce Bulk API 2.0,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
是否有人尝试在 SSIS 脚本任务中使用 SALEsforce BulK API 2.0。我能够创建作业并从 sql 查询生成 CSV,但是当我尝试使用 http PUT 方法将数据添加到作业时,它不起作用。按照链接创建有关如何创建作业然后将数据添加到作业的步骤。 https://Trailhead.Salesforce.com/en/content/learn/v/modules/api_basics/api_basics_bulk#:~:text=Bulk%20API%20is%20based%20on,the%20request%20in%20the%20BACkground。
//********************CREATE JOB*****************************
httpClIEnt createClIEntCreateJob = new httpClIEnt();
String requestCreateJobmessage = "{\"object\" : \"Account\"," +
"\"ContentType\" : \"CSV\"," +
"\"operation\" : \"insert\"," +
"\"lineEnding\": \"CRLF\"} ";
System.windows.Forms.messageBox.Show(requestCreateJobmessagE);
httpContent contentCreateJob = new StringContent(requestCreateJobmessage,EnCoding.UTF8,"application/Json");
String uriCreateJob = sfserviceUrl + "/services/data/v50.0/jobs/ingest";
httprequestmessage requestCreateJob = new httprequestmessage(httpR_772_11845@ethod.Post,uriCreateJob);
requestCreateJob.headers.Add("Authorization","Bearer " + sfOauthToken);
requestCreateJob.headers.Accept.Add(new MediaTypeWithQualityheaderValue("application/Json"));
requestCreateJob.Content = contentCreateJob;
httpResponsemessage responseCreateJob = await createClIEntCreateJob.SendAsync(requestCreateJob);
var resultCreateJob = await responseCreateJob.Content.ReadAsStringAsync();
System.windows.Forms.messageBox.Show(resultCreateJob,"resultCreateJob");
String batchID = resultCreateJob.SubString(7,18);
System.windows.Forms.messageBox.Show("batch job created successfully - " + batchID);
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
以上是大佬教程为你收集整理的SSIS 脚本任务中的 Salesforce Bulk API 2.0全部内容,希望文章能够帮你解决SSIS 脚本任务中的 Salesforce Bulk API 2.0所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。