codeulike
codeulike

Reputation: 23064

Setting Timeout value for Salesforce Web Service/API

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.

Upvotes: 2

Views: 6137

Answers (1)

kiwipom
kiwipom

Reputation: 7709

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...

Upvotes: 3

Related Questions