Asynchronous Web Services

S

sing

Hello All

Can one implement asynchronous web service calls between web services implemented in different technologies for example J2EE and .NET

Lets consider a scenario where a user clicks a button in an .aspx file and this calls a method in a web service implemented in J2EE technologies. Now when calling the web service can one pass the callback delegate from .aspx to the asynchronous method call in J2EE web service

My next question is "If a method is called in an asynchronous manner from A.aspx and the execution flows to a different page say B.aspx at the client side...once the aynchronous method has finished its execution would the control be reached to the callback delegate which is in a different page

I hope that I framed the question properly!

Any pointers/snippers/tutorials would be appreciated.....

TIA
 
J

Jan Tielens

Sure, no problem!

Remember that acutally .NET doesn't know in what language the web service is
implemented in. It only uses the default SOAP protocol to be able to
communicate. In your client project there are proxy classes (in .NET code!)
generated that handle all the rest. If you want to do async invocation,
check out the BeginXXX end EndXXX (where XXX is the name of your webmethod).
They enable you to do async invocation of web service proxies.

Regarding your page question, I suggest you post that question in the
ASP.NET newsgroup.

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


sing said:
Hello All,

Can one implement asynchronous web service calls between web services
implemented in different technologies for example J2EE and .NET?
Lets consider a scenario where a user clicks a button in an .aspx file and
this calls a method in a web service implemented in J2EE technologies. Now
when calling the web service can one pass the callback delegate from .aspx
to the asynchronous method call in J2EE web service?
My next question is "If a method is called in an asynchronous manner from
A.aspx and the execution flows to a different page say B.aspx at the client
side...once the aynchronous method has finished its execution would the
control be reached to the callback delegate which is in a different page?
 
S

Sami Vaaraniemi

sing said:
Hello All,

Can one implement asynchronous web service calls between web services
implemented in different technologies for example J2EE and .NET?

Yes.
Lets consider a scenario where a user clicks a button in an .aspx file and
this calls a method in a web service implemented in J2EE technologies. Now
when calling the web service can one pass the callback delegate from .aspx
to the asynchronous method call in J2EE web service?

Sort of. Typically when you call a web method asynchronously, the call is
asynchronous in the *consumer* side (i.e., in aspx code). The J2EE web
service has no idea it is being called asynchronously, and it is not the
J2EE web service that calls
the callback delegate once the call is complete. Instead, it is the consumer
side proxy code that calls back to aspx code once the call is complete.
My next question is "If a method is called in an asynchronous manner from
A.aspx and the execution flows to a different page say B.aspx at the client
side...once the aynchronous method has finished its execution would the
control be reached to the callback delegate which is in a different page?

Calling a web service asynchronously from an aspx page is a somewhat complex
topic. Even if you make the web service call asynchronously from aspx code,
the web request should not return before the web service call is completed.
The execution will not flow to B.aspx because the first request to A.aspx
will not return until the web service request is completed.

The reason for calling a web service asynchronously from an aspx page is to
free the ASP.NET worker thread so it can serve other requests while the web
service call is in progress.

Now, it would probably be possible to call the web service asynchronously
and have the aspx page request return immediately. The problem with this
approach is that there is no simple way of getting the web service call
results back to the user's browser when the call completes. You would have
to store the results somewhere and the user would have to reload the page
(or the browser could reload it automatically) in order to show the results.
Also, you would have to somehow associate the results you stored with the
subsequent request.

As I said, it is a complicated topic... maybe this article can clarify it
better than I can:

http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/default.aspx

Sami
www.capehill.net
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top