Re: Web Page & WebService Threading Example

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Peter,

From your description, what you want to do is implement an async pattern
for calling a long run webservice method from an ASP.NET web application.

Yes, I think the pattern you mentioned is workable. Your current idea is
make the async processing tracking (and status management) at the
webservice side. the client calling web application will pull the status
and result by keep calling webmethod from that webservice, correct?

Here is an MSDN article mentioned another pattern for processing such
long-run task in async mode:

#How To: Submit and Poll for Long-Running Tasks
http://msdn2.microsoft.com/en-us/library/ms979200.aspx

the idea in it is put all the async call and status polling(and management)
at client calliing side(asp.net application). You use the auto-generated
async webmethod (beginXXX and endXXX) to call the webservice asynchornouly
and use the callback handler to update status table. Also, you need a
polling page to constantly poll the status table to check whether a certain
task has finished. The advantage here is that it doesn't require your
server-side webservice to change much.

BTW, since your webservice execute long-run task, you may need to adjust
the timeout setting (for both server-side ASP.NET webservice application)
and the client-side webservice proxy so as to avoid timeout exception. Here
is a former thread where I've mentioned the related timeout settings:

#Timeout Calling Web Service
http://bytes.com/forum/thread425416.html

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: "Peter" <czupet@xxxxxxxxxxxxx>
References: <#R0vrsKpIHA.4928@xxxxxxxxxxxxxxxxxxxx>
<ROudnUcVUMSs2ZPVnZ2dneKdnZydnZ2d@xxxxxx>
Subject: Re: Web Page & WebService Threading Example
Date: Tue, 22 Apr 2008 15:43:28 -0500
Lines: 49
That's what was saying in steps 1 thrugh 4, I just wondering if there's an
example or if someone has a better idea.


"Aidy" <noemail@xxxxxxxxxxx> wrote in message
news:ROudnUcVUMSs2ZPVnZ2dneKdnZydnZ2d@xxxxxxxxx
The webpage will time out even if it is active as IIS will determine
that
the page is probably hanging or in a loop or just being a resource hog
so
will want to get the thread back. Basically you shouldn't call long
running tasks from a web page. Want kind of access do you have over the
server? You could install something like a web service that did the
long-running call and exposed a way to query the progress to your site.

"Peter" <czupet@xxxxxxxxxxxxx> wrote in message
news:%23R0vrsKpIHA.4928@xxxxxxxxxxxxxxxxxxxxxxx
I have a Web page which calls a WebService, this web service call might
take few seconds to up 30 min
I was thinking of having a webpage query the webservice every minute to
keep it form timing out, but I am not sure how to do that,
somehow I have to have the webpage query the status of the Webservice
request every minute or so to keep it from timing out.

I was thinking to do the following:

1) Web page calls a webservice
2) A web service spans a thread and returns some thread id to the
calling
webpage
3) The web page keeps calling the webservice with this thread id every
minute as long as the webservice confirms the thread is running, that
way
the web page will not timeout
4) Once the thread is completed the web page calls the webservice again
and retrieves the final result.

Does anyone has an example of such process or a better idea of how this
should be done?


Thank you


Peter










.



Relevant Pages

  • RE: Possible to consume a web service with VB.NET 1.1 VS 2003?
    ... webservice is aiming at interop between heterogenious platforms. ... Microsoft MSDN Online Support Lead ... Possible to consume a web service with VB.NET 1.1 VS 2003? ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: VBA access to WSE web service?
    ... \par Yes, you're right, COM interop is one possible approach as long as the client machine also has .net framework and WSE installed... ... \par Microsoft Online Support ... \par Subject: Re: VBA access to WSE web service? ... \par>Regarding on the calling WSE protected XML Webservice through Office ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: Ajax, Webmethod, PageMethod (multiple versions)
    ... calling remote AJAX webservice: ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ... all specific loging into web Service will be the best case for you. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: VBA access to WSE web service?
    ... WSE, so it's just a protocol issue. ... >Regarding on the calling WSE protected XML Webservice through Office ... >Also, even office toolkit support HTTP, since the WSE component protect the ... VBA access to WSE web service? ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • RE: User Security?
    ... The authentication is "Integrated Windows Authentication". ... Currently I am trying to access the web service thru IE6. ... you're developing an ASP.NET webservice which hosted ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.webservices)