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
crtest1crtest1 

service URL for Partner WSDL API with OAuth

Hi,

 

As I posted in this thread: http://boards.developerforce.com/t5/Security/Using-Partner-WSDL-API-with-OAuth/td-p/302435, Simon mentioned I just need to replace sessionId with access token in the SessionHeader. When i set property to binding in binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, service_url);, what url should I use here? Before I use "https://www.salesforce.com/services/Soap/u/21.0". With OAuth, I have instance_url as "https://na3.salesforce.com" for one user. Should I use this instance_url instead of previous soap url?

 

Thanks,

Michael

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

You can either manually build the correct Url (replace the host name with the host name from the instanceUrl), or call the identity service (do a GET on the Url in the Id field of your oauth response, the response from that URL includes the correct URLS for a number of services including the soap api). the OAuth docs have more details (including a trick to have the version # substituted in for you)

All Answers

SuperfellSuperfell

You can either manually build the correct Url (replace the host name with the host name from the instanceUrl), or call the identity service (do a GET on the Url in the Id field of your oauth response, the response from that URL includes the correct URLS for a number of services including the soap api). the OAuth docs have more details (including a trick to have the version # substituted in for you)

This was selected as the best answer
crtest1crtest1

Hi SImon,

 

I manually build the URL and it works!!!.

 

Thank you very much.

 

Michael

hafizsohaibalihafizsohaibali

can u please tell me how to replace version with correct verion of patner api url

 

thanks in advance