Webservice method runs even after Client gets timeout exception

I've a utility DLL. I created a webservice method which calls a method from the Utility DLL. The webservice is deployed. A client application (windows form application) is created to consume the webservice method. If the webservice method takes more time, the timeout exception is received in the windows form application whereas the actual method (from Utility DLL) is getting completed. All what I want is that, if the windows form method gets timeout exception then the webservice method (from Utility DLL) should NOT complete its execution. How to achieve this? Kindly help on this. Thanks!!!!
LVL 16
Easwaran ParamasivamAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPRetiredCommented:
you have a client that asks a service to do something the service starts processing  and the client times out so now you want the client to send a command to have the service stop processing?

IMHO the correct thing is to debug the service and find out where it is hanging. that or increase your timeout.
Easwaran ParamasivamAuthor Commented:
Thanks. In client side (where the webservice is consumed) I increased the timeout as 2 minutes. But that did not solve the issue. Is there anyway to specify the same timeout in the Web service method itself?  If so, will that solve my issue?
David Johnson, CD, MVPRetiredCommented:
I would be debugging the web service and not the client
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Easwaran ParamasivamAuthor Commented:
Well. The web service has one method calling a method from a Utility DLL. Please suggest.
Easwaran ParamasivamAuthor Commented:
The web service method contain body as given below:


ResponseType rs;
rs = UtilObj.ProcessMessage(RequestXML);

Open in new window

There is no problem of the web service method takes long time. If it takes more than 2 minutes I need to STOP the method executing further.
David Johnson, CD, MVPRetiredCommented:
There is no problem of the web service method takes long time. If it takes more than 2 minutes I need to STOP the method executing further.
then you need to set a timer in the web service and then start the process in another thread.. if the timer reaches 120 seconds then kill the thread and return failure to the client.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Easwaran ParamasivamAuthor Commented:
Could you please provide some sample code to accomplish that?
Easwaran ParamasivamAuthor Commented:
@David Johnson, MVP: Could you please provide sample code explaining your approach?
Easwaran ParamasivamAuthor Commented:
Thanks. For the sample code I look for I would raise another question.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.