473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Display 'In Process' page when calling async WebService

Hi all,

Can anyone give me some links about how to do an async web service call
from aspx and display a temperary page before the web service returns?

Thanks,
Homa Wong

Nov 23 '05 #1
5 4018
Hi,

Hopefully the following link may help you.

http://msdn.microsoft.com/library/de...chronously.asp

cheers,

Jerome. M

"Homa" wrote:
Hi all,

Can anyone give me some links about how to do an async web service call
from aspx and display a temperary page before the web service returns?

Thanks,
Homa Wong

Nov 23 '05 #2
Hi,

The Following link may help you to understand beeterly about the waithandle.
I hope you can make you of this, to display the "In Process Page" during your
async call.

Cheers,

Jerome. M
"Homa" wrote:
Hi all,

Can anyone give me some links about how to do an async web service call
from aspx and display a temperary page before the web service returns?

Thanks,
Homa Wong

Nov 23 '05 #3
Hi,

The problem with ASP.NET is when a "In Progress page" is displayed, the
HttpContext already end response, i.e., all information are sent to the
client. So when a callback returns, nothing more can be written to the
client's browser. And if I do a redirect, it result an error because
the code behind class doesn't know which browser it should communicate
to (because it ended response to the browser thus the client browser is
in a "disconnected" state).
I can think of two ways to do this.

1. Use JavaScript.
Have a timed redirect script inject to the "In Progress page." When
times up, the page redirects to the result page and if the result is
not ready, it goes back to the "In progress page" and wait again until
the result is ready (or timeout). The problem of this is the timed
parameter is fixed because you don't know in real time how long will
the web service take to return your call. So in the worst case it takes
twice as long to get the result (of course, this can be reduced but
it's kind of like a passive fix to the problem).

2. Tell the "In progress page" to send part of the page to the client
browser while waiting for the result. This would be ideal but I don't
know how to do it.

I don't have much problem dealing with async call directly, but how the
Page and the Client browser interact to get the solution works.

The solution I want is like the bank websites that after you login, it
display a page saying "We are gathering your information..." and then
direct you to summary page of your bank account.

Thanks,
Homa Wong

DotNetJerome wrote:
Hi,

The Following link may help you to understand beeterly about the waithandle. I hope you can make you of this, to display the "In Process Page" during your async call.

Cheers,

Jerome. M
"Homa" wrote:
Hi all,

Can anyone give me some links about how to do an async web service call from aspx and display a temperary page before the web service returns?
Thanks,
Homa Wong


Nov 23 '05 #4
I've never done this before but I imagine you need Response.Flush... something
like this.

private void Page_Load(object sender, System.EventArgs e)
{
Response.Write("Wait 4 Seconds...<BR><BR>");
Response.Flush();

System.Threading.Thread.SpinWait(99999999);

Response.Write("4 seconds is up. Redirecting in 4 seconds to google.com");
Response.Flush();

System.Threading.Thread.SpinWait(99999999);
Response.Write("<script>window.location='http://www.google.com';</script>");
Response.End();
}

For some reason this code I have posted doesn't totally work cause sometimes
the 'wait 4 seconds' message doesn't show up. Its just to give you an idea
and you can play around with it.

http://blogs.msdn.com/nunos/archive/....aspx#FeedBack might
help you.

-Trevor
Hi,

The problem with ASP.NET is when a "In Progress page" is displayed,
the
HttpContext already end response, i.e., all information are sent to
the
client. So when a callback returns, nothing more can be written to the
client's browser. And if I do a redirect, it result an error because
the code behind class doesn't know which browser it should communicate
to (because it ended response to the browser thus the client browser
is
in a "disconnected" state).
I can think of two ways to do this.
1. Use JavaScript.
Have a timed redirect script inject to the "In Progress page." When
times up, the page redirects to the result page and if the result is
not ready, it goes back to the "In progress page" and wait again until
the result is ready (or timeout). The problem of this is the timed
parameter is fixed because you don't know in real time how long will
the web service take to return your call. So in the worst case it
takes twice as long to get the result (of course, this can be reduced
but it's kind of like a passive fix to the problem).

2. Tell the "In progress page" to send part of the page to the client
browser while waiting for the result. This would be ideal but I don't
know how to do it.

I don't have much problem dealing with async call directly, but how
the Page and the Client browser interact to get the solution works.

The solution I want is like the bank websites that after you login, it
display a page saying "We are gathering your information..." and then
direct you to summary page of your bank account.

Thanks,
Homa Wong
DotNetJerome wrote:
Hi,

The Following link may help you to understand beeterly about the

waithandle.
I hope you can make you of this, to display the "In Process Page"

during your
async call.

Cheers,

Jerome. M
"Homa" wrote:
Hi all,

Can anyone give me some links about how to do an async web service
call
from aspx and display a temperary page before the web service
returns?
Thanks,
Homa Wong


Nov 23 '05 #5
Hi,
I actually found the solution. Here is the link.

http://msdn.microsoft.com/msdnmag/is...s/default.aspx

Cheers,
Homa Wong

Trevor Pinkney wrote:
I've never done this before but I imagine you need Response.Flush... something like this.

private void Page_Load(object sender, System.EventArgs e)
{
Response.Write("Wait 4 Seconds...<BR><BR>");
Response.Flush();

System.Threading.Thread.SpinWait(99999999);

Response.Write("4 seconds is up. Redirecting in 4 seconds to google.com"); Response.Flush();

System.Threading.Thread.SpinWait(99999999);
Response.Write("<script>window.location='http://www.google.com';</script>"); Response.End();
}

For some reason this code I have posted doesn't totally work cause sometimes the 'wait 4 seconds' message doesn't show up. Its just to give you an idea and you can play around with it.

http://blogs.msdn.com/nunos/archive/....aspx#FeedBack might help you.

-Trevor
Hi,

The problem with ASP.NET is when a "In Progress page" is displayed,
the
HttpContext already end response, i.e., all information are sent to
the
client. So when a callback returns, nothing more can be written to the client's browser. And if I do a redirect, it result an error because the code behind class doesn't know which browser it should communicate to (because it ended response to the browser thus the client browser is
in a "disconnected" state).
I can think of two ways to do this.
1. Use JavaScript.
Have a timed redirect script inject to the "In Progress page." When
times up, the page redirects to the result page and if the result is not ready, it goes back to the "In progress page" and wait again until the result is ready (or timeout). The problem of this is the timed
parameter is fixed because you don't know in real time how long will the web service take to return your call. So in the worst case it
takes twice as long to get the result (of course, this can be reduced but it's kind of like a passive fix to the problem).

2. Tell the "In progress page" to send part of the page to the client browser while waiting for the result. This would be ideal but I don't know how to do it.

I don't have much problem dealing with async call directly, but how
the Page and the Client browser interact to get the solution works.

The solution I want is like the bank websites that after you login, it display a page saying "We are gathering your information..." and then direct you to summary page of your bank account.

Thanks,
Homa Wong
DotNetJerome wrote:
Hi,

The Following link may help you to understand beeterly about the

waithandle.
I hope you can make you of this, to display the "In Process Page"

during your
async call.

Cheers,

Jerome. M
"Homa" wrote:
Hi all,

Can anyone give me some links about how to do an async web service

call
from aspx and display a temperary page before the web service

returns?
Thanks,
Homa Wong


Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Alan Z. Scharf | last post by:
1. I have a chain of six asynch callbacks initiated by a button, and want the page to refresh at the end of each callback to display A. Results of a SQLServer query showing cumulative running...
12
by: Raymond Lewallen | last post by:
How to wait for a process to stop completion is my goal. Obviously, the looping while waiting for the HasExited property is not a solution.. but thats the best I can come up off the top of my...
1
by: David Elliott | last post by:
I have a distributed system that processes documents. There currently is an Async Webservice in place and this works fine. My customer is requesting a Sync Webservice call. I am trying to...
5
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page...
0
by: Jens Weibler | last post by:
Hi, I'm trying to call a webservice asynchronous and works. But if I enter a wrong proxy webservice.Proxy = new WebProxy("b"); I won't get a callback with an async call like...
14
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So,...
7
by: christian13467 | last post by:
Hi, I'm using ASP.Net 2.0 with IIS 6.0 on windows server 2003 sp1. Calling a commandline program or a cmd file using Process.Start inside a webservice method. The call to Process.Start returns...
1
by: Cam Drab | last post by:
If this async call is running when I close the form, it appears to still be running (through the while-statement loop) even after the form.closed. In the FormClosing event I set the killedApp to...
1
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... There are a few questions wrapped up in this, but the main one is that the WebService.MyMethodAsync() methods that are automatically generated in the client code by VS 2005 don't seem to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.