【问题标题】:The SOAP request must use SOAP 1.1, did not receive a SOAP 1.1 Envelope as the document rootSOAP 请求必须使用 SOAP 1.1,没有收到 SOAP 1.1 Envelope 作为文档根
【发布时间】:2018-05-14 12:17:52
【问题描述】:

我正在尝试使用 CURL 命令创建批量 API 作业。我的文件 job.txt 如下-

<?xml version="1.0" encoding="UTF-8"?>
<jobInfo xmlns="http://www.force.com/2009/06/asyncapi/dataload">
<operation>Query</operation>
<object>account</object>
<contentType>CSV</contentType>
</jobInfo> 

curl 命令如下-

curl https://XXXXX.salesforce.com/services/Soap/u/42.0 -H "X-SFDC-Session:XXXXXXXXX" -H "Content-Type: text/xml; charset=UTF-8" -H "SoapAction":Query -d @job.txt 

但是当我执行上述命令时,我收到如下错误-

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://shemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapev:VersionMismatch</faultcode><faultstring>The SOAP request must use SOAP 1.1, did not recieve a SOAP 1.1 Envelope as the document root</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>

我是 SFDC 批量 API 的新手

【问题讨论】:

标签: salesforce salesforce-service-cloud salesforce-communities


【解决方案1】:

您正在调用应该调用 REST 端点的 SOAP 端点(或在 SOAP 端点上使用 SOAP 请求)。

我认为您正在使用此示例:https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_code_curl_walkthrough.htm。如果是这种情况,您使用了错误的请求 URL。试试/services/async/42.0/job 而不是/services/Soap/u/42.0

【讨论】:

  • 非常感谢。我已经更改了我的网址,它对我有用。谢谢!:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-07-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-04-10
  • 2011-09-21
相关资源
最近更新 更多