views:

362

answers:

1

The API for Salesforce is a web service, you set it up by downloading a WSDL file from Salesforce and adding the WSDL to your .NET project.

But I can't find anywhere to set the Timeout value.

Normally in a .NET Web Service there is a Timeout property for this (as described in this question), but I can't seem to find one in this case.

+1  A: 

Having attached the WSDL to your .net App, you can configure the Timeout property on the proxy class like:

PartnerReference.SforceService partnerRef = new PartnerReference.SforceService();
partnerRef.Timeout = 30000;
partnerRef.UseDefaultCredentials = true;
partnerRef.Proxy = System.Net.WebRequest.DefaultWebProxy;
partnerRef.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;

PartnerReference.LoginResult loginResult = partnerRef.login("Name", "Password");

I'm fairly sure that this will work for the Enterprise WSDL, too...

IanR
Thanks, I'm sure I checked out the SforceService object and couldn't find the Timeout property earlier ... but you're right - its there.
codeulike