1

I have auto-generated a C# client from a WSDL (https://eu7.salesforce.com/setup/build/generateEnterpriseWsdl.apexp). This works fine until someone changes the structure of one of the tables I'm querying e.g. add a new column. After that my service calls begin throwing a runtime exception. I have to download the latest WSDL and re-generate the client, re-compile and re-deploy.

Is there a simpler way? I can understand re-naming columns breaking my client, but someone adding new columns that I'm not using is annoying.

2

You should try using the Partner WSDL instead if you expect a lot of change. The Enterprise WSDL changes every time a new field is added whereas the Partner WSDL is loosely typed and does not.

A comparison can be found here.

  • Thanks. I'll try it. I just downloaded it from eu7.salesforce.com/soap/wsdl.jsp and it appears custom fields are missing which is a problem as I need to select data from some of them. – Tom Jul 23 '18 at 14:35
  • 2
    @Tom The Partner WSDL is a "loosely type" WSDL; it doesn't include the custom objects and fields in your org, but it does allow you to use those fields using dynamic field references. – sfdcfox Jul 23 '18 at 15:23
1

Unfortunately there doesn't seem to be any other way other than re-generating the client from the latest WSDL. And I would think this to be an expected behavior considering any change to the source should be published to the consumers to get the updated changes.

And because you need to use custom fields, so you have to use Enterprise WSDL for that purpose (which you already are doing). And that because you using Enterprise WSDL, it is strongly typed to your organization, so every time there's a change in your org, it changes the WSDL too.

Refer to the excerpt below from the help article:

Enterprise WSDL:

a) The Enterprise WSDL is strongly typed.

b) The Enterprise WSDL is tied (bound) to a specific configuration of Salesforce (ie. a specific organization's Salesforce configuration).

c) The Enterprise WSDL changes if modifications (e.g custom fields or custom objects) are made to an organization's Salesforce configuration.

  • Thanks. This is pretty much what I thought. Was hoping someone another suggestion beyond using the REST API. – Tom Jul 23 '18 at 15:03
  • If you really have an option to go to REST, then that will be helpful. But if you are building an application which is strongly typed to your org metadata and that you are using SOAP, unfortunately there's no other way. – Jayant Das Jul 23 '18 at 15:27

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.