我正在使用Savon从使用ruby on rails应用程序执行describeSObject调用时遇到一些问题。有人可以分享一下我的肥皂体看起来应该是什么样的例子:过去的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中找出最终的肥皂体看起来像什么。我没有太多运气就浏览了salesforce论坛和文档。
这是这个操作的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>
答案 0 :(得分:1)
<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>