Search code examples
.netwinformsweb-servicestimeout

How to increase the timeout period of web service in asp.net?


I've created one web service which is of asmx type. And I'm using my web service in the .net windows application.

Web method from the web service receives byte array conversion of the object & object of my class having different attributes in which i'm adding one xml file in the form of the string. When my string containing xml data increases then it gives me the "Time out" error while sending data to the the web service.

How to increase the timeout period of web service?


Solution

  • you can do this in different ways:

    1. Setting a timeout in the web service caller from code (not 100% sure but I think I have seen this done);
    2. Setting a timeout in the constructor of the web service proxy in the web references;
    3. Setting a timeout in the server side, web.config of the web service application.

    see here for more details on the second case:

    http://msdn.microsoft.com/en-us/library/ff647786.aspx#scalenetchapt10_topic14

    and here for details on the last case:

    How to increase the timeout to a web service request?