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 you开发者_StackOverflow社区r .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.
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...
精彩评论