• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Asynchronous call in the Server side?.,

 
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends..

i'm wondering about how to implement Asynchronous call in the Server side?..
(the Server used is Glassfish)..

is there any turorial or link for develop it?..
sorry i'm still beginner in developing WebService..

Thanks in advance..
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!
You are asking about asynchronous calls on the server side - do you mean asynchronous invocation of other web services from a web service or do you mean implementing a web service that processes request asynchronously? If the latter, then:
In order for your web service server to be asynchronous, an option is to follow something along these lines:
- Receive a request.
- Validate the request to the extent possible.
- Generate an id for the request (only if polling is used).
- Associate the id with the request (only if polling is used).
- Queue the request in a queue of some sort.
- Return the id (only if polling is used).

At this time, the client has completed the request and received a result, optionally containing an id with which it can poll for the result of the request later.

At some point in time in the web service server:
- The request is taken from the queue and processed.
- If the result is to be returned using callback, then call back and enclose the result.
- If the result is to be returned using polling, then place the request result in the polling queue.
Later when the client calls the polling function, supplying the request id, the result is returned to the client.

The above is a basic outline of how to implement asynchronous processing of requests in a web service. There may be additional aspects to take into consideration.
I haven't seen any tutorials on this subject.
Best wishes!
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ivan, thanks for your reply..

sorry i try to "digest" step by step..


do you mean asynchronous invocation of other web services from a web service?



how to reach it?.. is it implemented as the Client side (use the Service class or Port interface)?..
is it implemented use @WebServiceRef?
reply
    Bookmark Topic Watch Topic
  • New Topic