2

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

  • 1
    You want to dynamically get a Salesforce WSDL for the logged in user? May I ask which WSDL and what for? The Partner WSDL should be the same for everyone. Do you want the Enterprise WSDL? You might be better off with the Partner WSDL outright, as it can adapt to any org you are connecting to. – Daniel Ballinger Aug 22 '14 at 9:15
  • At now I'm using Enterprise WSDL. In current version I have select box that let opportunity to get wsdl file localy from computer. Functionality is next: get WSDL file, parse it and get all complexTypes. But now I need to get wsdl info without uploading file from computer – Dusha Aug 22 '14 at 9:23
  • You can get all that data from the Partner WSDL using a single file. It is intended for exactly this purpose. – Daniel Ballinger Aug 22 '14 at 9:44
  • Can I get that file by URL? – Dusha Aug 22 '14 at 9:51
2

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.

| improve this answer | |

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.