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
Chris Berg 6Chris Berg 6 

.NET Sample code for SOAP API out of sync with the WSDL

None of the sample code I tried for .NET using the Enterprise WSDL would work until I modified it for an explicit "out" parameter.  Every .NET programmer that tries the sample code will hit this problem.  Example:

                // Call describeSObjects() passing in an array with one object type name
                DescribeSObjectResult[] dsrArray;
                client.describeSObjects(
                  header, // session header
                  null, // package version header
                  null, // locale options
                  new string[] { entityName }, // object name array
                  out dsrArray
                  );

Please SF, sync up your samples with the changes to your WSDL for a better .NET experience.  =)
SonamSonam (Salesforce Developers) 
Thanks for bringing this to our notice Chris, could you please share the documentation from where you got the sample code snippets.
I will validate this and forward to the appropriate team to get the changes made.
Colin KenworthyColin Kenworthy
Hi Sonam, you could start with the examples in this:
https://developer.salesforce.com/page/Consuming_Force.com_SOAP_and_REST_Web_Services_from_.NET_Applications

My developer cannot get the enterprise Query example to work - keeps getting "not enough parameters" error message (as per Chris Berg  suggestion above).