To test the Connector application:
Download and install the free implementation of Jabber Server from the following URL:
http://www.jabberstudio.org/projects/ejabberd/releases/view.php?id=610
Set the path of the bin directory of J2SDK by executing the following command at the command prompt:
set path=%path%;D:\j2sdk1.4.0_02\bin;
Copy the JabberClient.java, ChatRoom.java, MessageClass.java, SignUp.java, User Login.java, and SocketClass.java files to a folder on your computer. Use the cd command at the command prompt to move to the folder where you have copied the Java files. Compile the files by using the following javac command, as shown:
javac *.java
To run the Connector application, specify the following command at the command prompt:
java JabberClient
The user interface of the Connector application appears. Select File-> Signup to sign up for a new account in the Connector application. The Sign Up window appears.
Fill up the fields of the Sign Up window, as shown in Figure 2-10:
Figure 2-10: Specifying Information in the Sign Up Window
Click OK to generate the XML message.
Click Submit to create a new account in the Jabber server. The Jabber server returns a confirmation response, as shown in Figure 2-11:
Figure 2-11: The Signup Confirmation
Select File-> Login to log on to the Connector application as an existing user. The Login window appears.
Fill up the login information, as shown in Figure 2-12:
Figure 2-12: Specifying Information in the Login Window
Click the Submit button. The confirmation XML message appears, as shown in Figure 2-13:
Figure 2-13: The Login Confirmation Message
The Client Request text area shows the request for logging on to the Jabber server in the form of an XML stream and the Server Response text area shows the XML stream after successfully logging on to the Jabber server
Select File-> Logoff and click the Submit button to log off from the Connector application. The Logoff confirmation XML message appears.
Select File-> Unsubscribe and click the Submit button to unsubscribe from the Jabber server. The Unsubscribe confirmation XML message appears.
Select File-> Send Message to send a message to another end user connected to the Jabber server. The Send Message window appears.
Specify the text for the message in the Send Message window, as shown in Figure 2-14:
Figure 2-14: Specifying the Message Text
Click the Submit button. The confirmation message appears, as shown in Figure 2-15:
Figure 2-15: Message Confirmation
The Client Request text area shows the request, which includes a text message and the Server Response text area shows the XML stream after successfully sending the message to the Jabber server
Select File-> Enter Chat Room to enter a particular chat room.
Fill the name of the chat room in the Enter Chat Room window, as shown in Figure 2-16:
Figure 2-16: Specifying the Chat Room Name
Click the Submit button. The confirmation message appears, as shown in Figure 2-17:
Figure 2-17: Enter Chat Room Confirmation
The Client Request text area shows the request to enter the chat room specified by an end user and the Server Response text area shows the XML stream after successfully entering the chat room.