I have a website. An user can login into this site through salesforce login oAuth. I need to implement next functionality: after user login I should in some way get WSDL file relating to user account. In all tutorials, for example in this one:
https://help.salesforce.com/HTViewHelpDoc?id=dev_wsdl.htm&language=en_US
is described how to get a wsdl file using salesforce UI. But I need to get this file from URL. I didn't find any endpoint from which I can download wsdl. Could someone help me in this problem? Is it possible at all?
Thanks
Best Answer
Since it would appear your intention is to get various versions of the Enterprise WSDL, my answer would be - Don't, use the Partner API instead.
From the Docs: (my emphasis at the end)
You can pull exactly the same data using a single version of the Partner API. It is intended for scenarios where you will need to adapt to changes in the available types.
If you really really really want to use multiple versions of the Enterprise WSDL dynamically they you can use your session details to extract the WSDL from https://yourPodInstanceHere.salesforce.com/soap/wsdl.jsp. Your will need to swap out yourPodInstanceHere with something like na5, cs2 depending on what pod you are connecting too. There are lots of examples on this site of how to set the HTTP request cookies (sid) with the Session Id you got from the OAuth process.
The Partner API is at https://na5.salesforce.com/soap/wsdl.jsp. Again, you will need the session cookie to get this. You only need to get it once per Salesforce release (e.g. Summer 14). It won't change until the next release.