3

I am trying to access Salesforce via the SOAP API (at the moment just using the python requests library). I have a developer account.

I am trying to use an existing OAuth access token as described in http://blogs.developerforce.com/developer-relations/2011/03/oauth-and-the-soap-api.html

I have an HTTP POST request with headers

SOAPAction: ""
Content-Type: text/xml; charset=utf-8

I am using the url from the "partner" member of the id response as in the blog post. Tried with both

https://na14.salesforce.com/services/Soap/u/25.0/00Dd0000000hsSa

and

https://na14.salesforce.com/services/Soap/u/25.0

A sample query body looks like:

<?xml version="1.0" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:parner.soap.sforce.com">
  <soapenv:Header>
    <urn:SessionHeader>
      <urn:sessionId>00Dd0000000hsSa!AREAQJN0ojV25Ra2uVqAQsAFTvhcetdBcxmTBJnPg6IwceRIAl9tbCsMy3P.qG3g7NRitIHXaaGH_ObF8oC0BSL9VXAGkCPT</urn:sessionId>
    </urn:SessionHeader>
  </soapenv:Header>
  <soapenv:Body>
    <urn:describeSObject>
      <urn:sObjectType>Account</urn:sObjectType>
    </urn:describeSObject>
  </soapenv:Body>
</soapenv:Envelope>

Response looks like:

<?xml version="1.0" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Body>
    <soapenv:Fault>
      <faultcode>soapenv:Client</faultcode>
      <faultstring>No operation available for request {urn:parner.soap.sforce.com}describeSObject</faultstring>
    </soapenv:Fault>
  </soapenv:Body>
</soapenv:Envelope>

What am I missing?

4

You have a typo in the xml namespace, you have

xmlns:urn="urn:parner.soap.sforce.com"

it should be

xmlns:urn="urn:partner.soap.sforce.com"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.