471,610 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

XML Web Service

Can a XML web service be called asynchronously from a web based
application. Have tried this:

WebService1.service proxy = new WebService1.service();
IAsyncResult result;
result = proxy.BeginLP(x, y, null, null);
Response.Redirect(string.Format("a.aspx?a={0}&b={1 }",x,y),true);

The web service is never called.

It is being called when I call it synchronously by using
proxy.LP(x, y);

Any suggestions or if someone can suggest a better architecture. I just
want to start the web service and later poll it from another page. Do
not need any handle. Also, is it necessary to call EndLP if we call
BeginLP.

Thanks
-R

Feb 7 '06 #1
2 1205
OldMacDonald,
You can invoke a webservice method asynchronously from any .NET code, the
problem is that when you do it from an ASP.NET page, which class has a
lifetime limited to generating and pushing out the html for the page through
IIS, you will never be around to handle your callback.

You can try doing it from a background thread, storing data in Application
state for example, to enable processing callback info.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"OldMacDonald" wrote:
Can a XML web service be called asynchronously from a web based
application. Have tried this:

WebService1.service proxy = new WebService1.service();
IAsyncResult result;
result = proxy.BeginLP(x, y, null, null);
Response.Redirect(string.Format("a.aspx?a={0}&b={1 }",x,y),true);

The web service is never called.

It is being called when I call it synchronously by using
proxy.LP(x, y);

Any suggestions or if someone can suggest a better architecture. I just
want to start the web service and later poll it from another page. Do
not need any handle. Also, is it necessary to call EndLP if we call
BeginLP.

Thanks
-R

Feb 7 '06 #2
Thanks for the reply Peter. I finally could make it to work. And the
way I designed it, was that I would not require a handle to it as I do
several DB inserts so on the redirected page, I poll every 30 seconds
to the DB and find out the status of it. So that solves my problem.
Thanks again.

Feb 7 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Hardy Wang | last post: by
7 posts views Thread by Mike | last post: by
9 posts views Thread by SP | last post: by
3 posts views Thread by Jeremy S. | last post: by
dmjpro
3 posts views Thread by dmjpro | last post: by
20 posts views Thread by =?Utf-8?B?cmtibmFpcg==?= | last post: by
5 posts views Thread by dm3281 | last post: by
1 post views Thread by XIAOLAOHU | last post: by
1 post views Thread by ZEDKYRIE | last post: by

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.