English 中文(简体)
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.

最佳回答

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

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签