Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

asynchronuous call  RSS feed

 
tarik elberrak
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have writen a webservice client to get some data from a webservice server. my call will display an html file(Crystal Report report got from the webservice server) into a jsp. the call makes about 9 seconds to get data to display (too long for the client), the web site contains just two pages (login page and a page to display data (for each report choosen in a menu)). Is there a way to make an asynchronuous call and notify the client when the DATA is ready. I mean, the client can ask for a report1 (in the menu), see other ready reports and will be notified when the report1 is ready (got from the webservice).
any help will be appreciated


----------------------------------------------------------------------------
SGCIB
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because HTTP is being used as a transport there is no way for the Web Service to get back to the Web Client, unless the Web client is also a Web Service. You have different options depending on the environment that your Web client is running in.
The easiest solution is to launch a separate thread to issue the Web Service request and process the response. For Example, BEA Weblogic can generate stubs that include such functionality. BEA's Generated Asynchronous Web Service Client Stub. Of course you can't do that in an EJB environment.
In a J2EE environment Sun's standard solution is to have the Web Service post the result to a JMS Queue where the client can access the result of the request when it becomes available. Other than that you could split the request submission and the response retrieval over two Web methods that use a correlation identifier - i.e. after submission you go away and try later to see if the response is ready yet.
Asynchronous operations and Web services, Part 1: A primer on asynchronous transactions
Asynchronous operations and Web services, Part 2
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!