Friday, October 01, 2004

VJs Tip Of The Day - October 1st 2004

Setting Timeouts for WebServices

If your webservice takes a long time to finish its expected task and you wish to increase the timeout values for your webservices following are few things you should look at:

Make sure that you set the desired timeout for your script. You can do that in your webservice by Server.ScriptTimeout = 2000 * 60 //(your value)

Also do note that the timeout for the proxy consuming the webservice should also be modified and should be made more than that the timeout of your webservice itself.
There is a timeout property created for the proxy class generated by WSDL tool you would have to set this property before you call your web service.

eg MyProxyClass objMyProxy = new MyProxyClass()
objMyProxy.Timeout = 5000 * 60 //(note the value is more than the web
// service timeout)
objMyProxy.MyWebMethod("take your time")


PS: At times I might not be able to reply to all the queries that you post to me... Believe me I keep them unread and will get back to them at the earliest leisure... I apologize for the inconvinience...

No comments: