2

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.

4
  • Have you used Visual Studio or wsdl.exe to generate proxy classes for the Salesforce web service? Commented Dec 10, 2009 at 23:41
  • Yes, the proxy classes are there and I can use them to call the web service. But there is no Timeout property as far as I can tell. Commented Dec 11, 2009 at 9:19
  • What base class does your proxy class inherit from? Normally the Timeout property comes from System.Web.Services.Protocols.WebClientProtocol Commented Dec 11, 2009 at 17:53
  • Proxy inherits from SoapHttpClientProtocol, which is a descendent of WebClientProtocol.I found the Timeout propery, right where it should have been. I dont know why I couldn't find it earlier ... Commented Dec 15, 2009 at 10:55

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks, I'm sure I checked out the SforceService object and couldn't find the Timeout property earlier ... but you're right - its there.
@kiwipom I dont understand where do I add this in my application. I dont have the timeout property :s
@raym0nd I haven't done any Salesforce work for over 3 years! Sorry, you'll need to ask a fresh question...
I asked a question here but no replies yet. stackoverflow.com/questions/16019359/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.