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
webdevwebdev 

Example of LoginScopeHeader

I will really appreciate if someone can tell me how to verify selfservice user in winter'07 release using LoginScopeHeader. An example would be great.

Thanks!
SuperfellSuperfell
You need to generate a request something like this.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <LoginScopeHeader xmlns="urn:enterprise.soap.sforce.com">
             <organizationId>00Dx00000004za8</organizationId>
 </LoginScopeHeader>
    </soap:Header>
    <soap:Body>
       <login xmlns="urn:enterprise.soap.sforce.com">
           <username>user@domain.com</username>
           <password>secret</password> 
       </login>
    </soap:Body>
</soap:Envelope>
Exactly how you do that will depend on what tools you're using.

Message Edited by SimonF on 12-15-2006 04:36 PM

webdevwebdev
I am not able to make it work.

Does anyone have perl code snippet for this?
webdevwebdev
Simon, I was able to implement it but the error I am getting is:

INVALID_LOGIN: Invalid username or password or locked out.

Any idea why?
SuperfellSuperfell
Are you using Sandbox ? (test.salesforce.com) that's the only instance that has winter '07 deployed to it so far. If so, are you sending up your own organizations Id in the header ? finally, you should double check the capitalization of the element names, and that the xml namespace on the element is correct.
webdevwebdev
I am using sandbox. I have solved the problem.

Thanks for your help.
MilanMilan

I try to invoke it using  my Dev credentials and I keep getting the same error : <sf:exceptionMessage>Invalid username or password or locked out.</sf:exceptionMessage>

The URL that I am using is :

https://www.salesforce.com/services/Soap/c/9.0

  1. Is this ther right URL ?

Also I am not sure what value to be used for the Organisation id . Currently XML SPy generated this request message and it has some aaaaaaaa... What value do I pass as my Organisation id ? I guess all it is interested is in 18 chars ..I guess.

Kindly advice . My XML request is as follows:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<SOAP-ENV:Header>

<m:LoginScopeHeader xmlns:m="urn:enterprise.soap.sforce.com">

<m:organizationId>aaaaaaaaaaaaaaaaaa</m:organizationId>

</m:LoginScopeHeader>

</SOAP-ENV:Header>

<SOAP-ENV:Body>

<m:login xmlns:m="urn:enterprise.soap.sforce.com">

<m:username>milan.doshi@demandbase.com</m:username>

<m:password>milan</m:password>

</m:login>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

Thanks for any help!

Regards,

Milan

SuperfellSuperfell
Can you clarify what you're trying to achieve? LoginScopeHeader is used purely for authenticating self service users. You should not be passing this header at all to do a login for a regular user account. Please see the docs/quickstarts to get up and running.
MilanMilan
Yes, Removing the header helped.
 

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

            <SOAP-ENV:Header>                      

            </SOAP-ENV:Header>

            <SOAP-ENV:Body>

                        <m:login xmlns:m="urn:enterprise.soap.sforce.com">

                                    <m:username>milan.doshi@mycompany.com</m:username>

                                    <m:password>mypassword</m:password>

                        </m:login>

            </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

Worked!Thanks Simon!

 

Regards,

Milan