Calling external web service on different thread from web service
This is current functionality:
This has been working fine. I have to add a feature so that after step 2, my web service will call 1 to 6 (depending upon condition) external web services. So it would look like this:
Now web site request could take 10 minutes because of this new feature. So this is how I would like to implement new feature.
Also, I would like set some timeout for the thread created in step 3 so that the task must end in let's say 10 minutes and if not abort the thread.
I tried ThreadPool.QueueUserWorkItem which does not even get called as it is background thread. Initially Thread / Task.TaskFactory seem doable but creating a new thread for each request does not seem best practice.
Can someone provide some VB.NET code / reference for the step 3? Specifically calling external web service on a separate thread something like fire and forget and setting timeout for that thread?
Thanks
closeTimeout="04:01:00"
openTimeout="04:01:00" receiveTimeout="04:10:00" sendTimeout="04:01:00"
allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8"
transferMode="StreamedResponse"
useDefaultWebProxy="true"
try this in your binding properties. It helps to increase timeout period and handle large datas(mb)
链接地址: http://www.djcxy.com/p/12926.html