function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AkoAko 

Getting INVALID_LOGIN

Hi. I am trying to initiate a login via SOAP using the WSDL (Enterprise or Partner) within Python. I keep getting an INVALID_LOGIN error. I am using the username and password and I use in the Developer Login on Salesforce.com, which I assume is correct?

Here is the outgoing and incoming SOAP (I have only altered the email and PW for this example, but I assure you they are correct)

Code:
*** Outgoing SOAP ******************************************************
<—xml version="1.0" encoding="UTF-8"–>
<SOAP-ENV:Envelope
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>
<SOAP-ENV:Body>
<login SOAP-ENC:root="1">
<v1 xsi:type="xsd:string">ako@myemail.com</v1>
<v2 xsi:type="xsd:string">mypassword</v2>
</login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
************************************************************************
*** Incoming SOAP ******************************************************
<˜xml version="1.0" encoding="UTF-8"™>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <soapenv:Fault>
   <faultcode xmlns:ns1="urn:fault.partner.soap.sforce.com">ns1:INVALID_LOGIN</faultcode>
   <faultstring>INVALID_LOGIN: Invalid username or password or locked out.</faultstring>
   <detail>
    <sf:fault xsi:type="sf:LoginFault" xmlns:sf="urn:fault.partner.soap.sforce.com">
     <sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode>
     <sf:exceptionMessage>Invalid username or password or locked out.</sf:exceptionMessage>
    </sf:fault>
   </detail>
  </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>
************************************************************************
I really don't know what I'm missing here. Can anyone offer any ideas? I am pretty new to this (obviously).

SuperfellSuperfell
Your request is unfortuanatly not particularly close to the required format.
1. there should be no encodingStyle attribute or it should be set to ""
2. the namespace for the login element is incorrect
3. the v1/v2 elements need to be called username and password respectively

You can see a sample login request on the wiki
http://wiki.apexdevnet.com/index.php/Enterprise_Login
AkoAko
Thanks a lot. I was assuming that the SOAP library I was using (SOAPpy) would handle that sort of stuff but obviously I need to spend a little more time with it. I'll see what I can do to make it format correctly.