[SalesForce] Import salesforce WSDL file from URL

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)

Partner Web Services WSDL—Used for client applications that are metadata-driven and dynamic in nature. It is particularly—but not exclusively—useful to salesforce.com partners who are building client applications for multiple organizations. As a loosely typed representation of the Salesforce data model that works with name-value pairs of field names and values instead of specific data types, it can be used to access data within any organization. This WSDL is most appropriate for developers of clients that can issue a query call to get information about an object before the client acts on the object. The partner WSDL document only needs to be downloaded and consumed once per version of the API.

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.

Related Topic