调用DescribeSObjects 的示例Soap 主体

发布于 2024-12-01 18:52:38 字数 1997 浏览 1 评论 0原文

我在使用 Savon 从 ruby​​ on Rails 应用程序进行描述SObject 调用时遇到了一些问题。有人可以根据过去使用 salesforce 合作伙伴 API 的经验或一般 wsdl 知识分享我的肥皂体应该是什么样子的示例吗?

这是我的应用程序生成的内容:

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:wsdl="urn:partner.soap.sforce.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ins0="urn:partner.soap.sforce.com" xmlns:ins1="urn:fault.partner.soap.sforce.com" xmlns:ins2="urn:sobject.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header>
        <wsdl:SessionHeader>
            <wsdl:sessionId>REMOVED</wsdl:sessionId>
        </wsdl:SessionHeader>
    </env:Header>
    <env:Body>
        <ins0:describeSObjects>
            <wsdl:object1>Action_Plans_Settings__c</wsdl:object1>
            <wsdl:object2>QuoteLineSyncField__c</wsdl:object2>
        </ins0:describeSObjects>
    </env:Body>
</env:Envelope>

我知道这是不正确的,但我很难仅从 wsdl 中弄清楚最终的肥皂体会是什么样子。我浏览过销售人员论坛和文档,但运气不佳。

这是此操作的 wsdl 定义,也许一些 wsdl 大师可以根据它来解决这个问题:

<operation name="describeSObjects">
    <documentation>Describe a number sObjects</documentation>
    <input  message="tns:describeSObjectsRequest"/>
    <output message="tns:describeSObjectsResponse"/>
    <fault  message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
    <fault  message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
</operation>

<message name="describeSObjectsRequest">
    <part element="tns:describeSObjects" name="parameters"/>
</message>

<element name="describeSObjects">
    <complexType>
        <sequence>
            <element name="sObjectType" type="xsd:string" minOccurs='0' maxOccurs='100' />
        </sequence>
    </complexType>
</element>

I'm running into some issues doing a describeSObject call from a ruby on rails application using Savon. Could someone share an example of what my soap body should look like either from past experience with the salesforce partner api or general wsdl knowledge?

Here's what my application is generating:

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:wsdl="urn:partner.soap.sforce.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ins0="urn:partner.soap.sforce.com" xmlns:ins1="urn:fault.partner.soap.sforce.com" xmlns:ins2="urn:sobject.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header>
        <wsdl:SessionHeader>
            <wsdl:sessionId>REMOVED</wsdl:sessionId>
        </wsdl:SessionHeader>
    </env:Header>
    <env:Body>
        <ins0:describeSObjects>
            <wsdl:object1>Action_Plans_Settings__c</wsdl:object1>
            <wsdl:object2>QuoteLineSyncField__c</wsdl:object2>
        </ins0:describeSObjects>
    </env:Body>
</env:Envelope>

I know this isn't correct, but I'm having trouble figuring out from the wsdl alone what the final soap body would look like. I've browsed the salesforce forums and docs without much luck.

Here's the wsdl definition for this operation, perhaps some wsdl gurus can figure this out based on it:

<operation name="describeSObjects">
    <documentation>Describe a number sObjects</documentation>
    <input  message="tns:describeSObjectsRequest"/>
    <output message="tns:describeSObjectsResponse"/>
    <fault  message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
    <fault  message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
</operation>

<message name="describeSObjectsRequest">
    <part element="tns:describeSObjects" name="parameters"/>
</message>

<element name="describeSObjects">
    <complexType>
        <sequence>
            <element name="sObjectType" type="xsd:string" minOccurs='0' maxOccurs='100' />
        </sequence>
    </complexType>
</element>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疯到世界奔溃 2024-12-08 18:52:38
<soapenv:Envelope 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:urn="urn:partner.soap.sforce.com">
  <soapenv:Header>
     <urn:SessionHeader>
        <urn:sessionId>someSessionId</urn:sessionId>
    </urn:SessionHeader>
  </soapenv:Header>
  <soapenv:Body>
     <urn:describeSObjects>
        <urn:sObjectType>Account</urn:sObjectType>
        <urn:sObjectType>Contact</urn:sObjectType>
     </urn:describeSObjects>
  </soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:urn="urn:partner.soap.sforce.com">
  <soapenv:Header>
     <urn:SessionHeader>
        <urn:sessionId>someSessionId</urn:sessionId>
    </urn:SessionHeader>
  </soapenv:Header>
  <soapenv:Body>
     <urn:describeSObjects>
        <urn:sObjectType>Account</urn:sObjectType>
        <urn:sObjectType>Contact</urn:sObjectType>
     </urn:describeSObjects>
  </soapenv:Body>
</soapenv:Envelope>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文