Reputation: 9870
I have a SOAP web service added to a console app and every time I make a specific call its timing out on me. Other calls work fine. How do I increase the timeout length in a console app? Seems like it's currently about 90 seconds.
Thanks.
Upvotes: 3
Views: 8178
Reputation: 1035
This should allow you to change the timeout and then verify that it has been changed.
public int Timeout { get; set; }
[Transaction(Timeout=30)]
public class TransactionAttribute_Timeout : ServicedComponent
{
public void TimeoutExample()
{
// Get the TransactionAttribute applied to the class.
TransactionAttribute attribute =
(TransactionAttribute)Attribute.GetCustomAttribute(
this.GetType(),
typeof(TransactionAttribute),
false);
// Display the current value of the attribute's Timeout property.
Console.WriteLine("TransactionAttribute.Timeout: {0}",
attribute.Timeout);
// Set the Timeout property value of the attribute to sixty
// seconds.
attribute.Timeout = 60;
// Display the new value of the attribute's Timeout property.
Console.WriteLine("TransactionAttribute.Timeout: {0}",
attribute.Timeout);
}
}
Upvotes: 0