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


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, 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)

*** Outgoing SOAP ******************************************************
<—xml version="1.0" encoding="UTF-8"–>
<login SOAP-ENC:root="1">
<v1 xsi:type="xsd:string"></v1>
<v2 xsi:type="xsd:string">mypassword</v2>
*** Incoming SOAP ******************************************************
<˜xml version="1.0" encoding="UTF-8"™>
<soapenv:Envelope xmlns:soapenv="" xmlns:xsd="" xmlns:xsi="">
   <faultcode xmlns:ns1="">ns1:INVALID_LOGIN</faultcode>
   <faultstring>INVALID_LOGIN: Invalid username or password or locked out.</faultstring>
    <sf:fault xsi:type="sf:LoginFault" xmlns:sf="">
     <sf:exceptionMessage>Invalid username or password or locked out.</sf:exceptionMessage>
I really don't know what I'm missing here. Can anyone offer any ideas? I am pretty new to this (obviously).

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
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.