Asynchronous Web Services

Discussion in 'ASP .Net Web Services' started by sing, Feb 16, 2004.

  1. sing

    sing Guest

    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
    sing, Feb 16, 2004
    #1
    1. Advertising

  2. sing

    Jan Tielens Guest

    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" <> wrote in message
    news:...
    > 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
    Jan Tielens, Feb 17, 2004
    #2
    1. Advertising

  3. "sing" <> wrote in message
    news:...
    > 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
    Sami Vaaraniemi, Feb 17, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gary Howlett

    Asynchronous Web Services

    Gary Howlett, Aug 19, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    414
    Natty Gur
    Aug 19, 2003
  2. Dave
    Replies:
    0
    Views:
    119
  3. Bill Zack
    Replies:
    4
    Views:
    126
  4. David Cornelson

    Asynchronous Web Services called from ASP.NET

    David Cornelson, Dec 8, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    141
    Ágúst
    Dec 9, 2003
  5. jez

    Asynchronous web services

    jez, Feb 15, 2005, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    142
Loading...

Share This Page