Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom XML Envelope for login #12

Open
jdsampayo opened this issue Mar 4, 2016 · 1 comment
Open

Custom XML Envelope for login #12

jdsampayo opened this issue Mar 4, 2016 · 1 comment

Comments

@jdsampayo
Copy link

Hello,

The company that hosts Salesforce for my client gave me this example of connection:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:tooling.soap.sforce.com">

  <soapenv:Header/>

  <soapenv:Body>
    <urn:login>
      <urn:username>USERNAME</urn:username>
      <urn:password>PASSWORD</urn:password>
    </urn:login>
  </soapenv:Body>

</soapenv:Envelope>

It connects correctly testing with curl.

However, if I use the default one from Salesforce site it doesn't login (https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_quickstart_login.htm )

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Body>
    <n1:login xmlns:n1="urn:partner.soap.sforce.com">
      <n1:username>USERNAME</n1:username>
      <n1:password>PASSWORD</n1:password>
    </n1:login>
  </env:Body>
</env:Envelope>

It gives me the error No operation available for request {urn:partner.soap.sforce.com}login which is the same error that this gem gives me trying to connect.

I was wondering if it can be the type of XML the problem or if I can override the envelope in some way.

Thsnk you,

@jheth
Copy link
Contributor

jheth commented Apr 2, 2016

Hey @jdsampayo , sorry for the delay. Namespaces are really important and need to match their respective tags.

In the first example you're using the prefix urn which maps to this namespace.
xmlns:urn="urn:tooling.soap.sforce.com"

In the second you are using n1 which maps to this namespace.
xmlns:n1="urn:partner.soap.sforce.com"

Does this gem work as expected for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants