XML Web Service

O

OldMacDonald

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
 
G

Guest

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
 
O

OldMacDonald

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top