【发布时间】:2021-06-09 17:52:38
【问题描述】:
我是 Salesforce 元数据 API 的新手。我想使用元数据 api 在 Salesforce 上创建联系人列表视图。
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://soap.sforce.com/2006/04/metadata">
<soap:Header>
<met:AllOrNoneHeader>
<met:allOrNone>false</met:allOrNone>
</met:AllOrNoneHeader>
<met:CallOptions>
<met:client>https://xyz.salesforce.com</met:client>
</met:CallOptions>
<met:SessionHeader>
<met:sessionId>xyz</met:sessionId>
</met:SessionHeader>
</soap:Header>
<soap:Body>
<met:createMetadata>
<!--Zero or more repetitions:-->
<met:metadata>
<!--Optional:-->
<met:fullName>TESTVIEW__c</met:fullName>
</met:metadata>
</met:createMetadata>
</soap:Body>
</soap:Envelope>
我得到了
[
{
"errorCode": "METHOD_NOT_ALLOWED",
"message": "HTTP Method 'POST' not allowed. Allowed are HEAD,GET"
}
]
我使用的端点是:
https://xyz.salesforce.com/services/data/v51.0/sobjects/Contact/listviews
我更新到 SOAP 端点:
https://xyz-dev-ed.my.salesforce.com/services/Soap/m/51.0/1112312DRED21
现在我得到了
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>content-type of the request should be text/xml</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
我想我更近了一步。有效载荷对创建联系人列表视图有效吗?
【问题讨论】:
标签: soap salesforce salesforce-lightning