2

By using "Generate Enterprise WSDL " I got the below login webservice for my salesforce org.

Login webservice

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
   <soapenv:Header>
      <urn:LoginScopeHeader>
         <urn:organizationId>?</urn:organizationId>
         <!--Optional:-->
         <urn:portalId>?</urn:portalId>
      </urn:LoginScopeHeader>
   </soapenv:Header>
   <soapenv:Body>enter preformatted text here
      <urn:login>
         <urn:username>username</urn:username>
         <urn:password>"mypassword+securitytoken"</urn:password>
      </urn:login>
   </soapenv:Body>


</soapenv:Envelope>

After running this in SOAP UI, I did not get the sessionId/ serverUrl. The error I got as below:

Output

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>INVALID_LOGIN</faultcode>
         <faultstring>INVALID_LOGIN: malformed id: organizationId '?'</faultstring>
         <detail>
            <sf:LoginFault xsi:type="sf:LoginFault">
               <sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode>
               <sf:exceptionMessage>malformed id: organizationId '?'</sf:exceptionMessage>
            </sf:LoginFault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
  • Can you once remove inside the header and test it – Nikitha Oct 9 '15 at 7:57
  • 2
    Can you remove inside the header like below: <urn:LoginScopeHeader> <urn:organizationId>?</urn:organizationId> <!--Optional:--> <urn:portalId>?</urn:portalId> </urn:LoginScopeHeader> – Nikitha Oct 9 '15 at 8:08
  • Thanks @Nikitha . After removing the header I got the sessionId and session url. – DOMINIC EDWARD Oct 9 '15 at 9:26
  • Ok fine Dominic... – Nikitha Oct 9 '15 at 9:36
1

You don't need to define the <urn:LoginScopeHeader> as part of the login API call unless you are authenticating a Self-Service user against a specific org and portal. If that isn't the case you can safely omit that header.

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.