• Post Reply Bookmark Topic Watch Topic
  • New Topic

Chat Web Service Using Axis  RSS feed

 
Christopher John Rigor
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Chat Web Service and a java application as client.

When the client "connects" or call the method connect(user) in the server, the user is listed in the server.

How then would the server know if the user already closed the client application? I could call a disconnect method before the user closes the application. But what if the application closes without calling the disconnect method?

Is there a way that the server would know that the user is not connected anymore?
 
James Clinton
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use asynchronous messaging.

Both the server and the client need to be a Web Service. A requester and provider. The provider hosts a WSDL for both the 'Chat Service' and the 'Chat Callback Service'.

The client then fetches the callback WSDL from the provider and builds a new one by importing the fetched wsdl <wsdl:import> and adding the port details of its client-side service.

The client can then generate the skeleton classes using wsdl2java and the server can do the same to build the stubs. The server can then invoke a isAlive() method or something similar to test if the client is there or not.

Look up 'Basic Callback Pattern' from the WS-I.

http://www.javapassion.com/webservices/WSIUsageScenarios4.pdf
http://www-106.ibm.com/developerworks/webservices/library/ws-iuse/
[ January 11, 2005: Message edited by: James Clinton ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!