A "Hello world" application.
This practical is a "warming up" exercise, to refresh your Java knowledge and
to have a simple Client/Server application running.
- Download the Java package cis69mc.jar
(Right Click, "Save as") and save it under the name cis69mc.jar
- Download the Client HelloClient.java
and save it under the name HelloClient.java
- Download the Server HelloServer.java
and save it under the name HelloServer.java
(1) Compile the client and server with the commands:
C:\jdk1.3.1_06\bin\javac -classpath "cis69mc.jar;." HelloServer.java
C:\jdk1.3.1_06\bin\javac -classpath "cis69mc.jar;." HelloClient.java
(2) Run the Server with the command:
C:\jdk1.3.1_06\bin\java -classpath "cis69mc.jar;." HelloServer
(3) Open another DOS shell and run the Client with the command:
C:\jdk1.3.1_06\bin\java -classpath "cis69mc.jar;." HelloClient
Further activities
(4) Change the server, so that it displays a different text, e.g. your name.
(5) Use the command ipconfig to get your ip number. Give your ip number to a friend, and run the server. Ask your friend to access your server.
(6) Change the client by replacing "localhost" with a valid ip number.
Make the xml visible
(7) Add the line
uk.co.wilson.xml.MinML.xmlinfo = true;
in your source code of the client and server, to make the XML visible
(this is a hack by Marc, and it will not work with the original package distributed by Apache). Note: The XML code that is received is shown, so on the server side you will see the XML sent from client to server and on the client side you see the XML sent from server to client.
Back to the main page
© Marc Conrad, 2003.
The material on this page is presented "as is". There is no warranty implied by presenting this stuff.
Feel free to use and modify the material for your own teaching.
When doing so please give a reference to this web site (http://perisic.com/xmlrpc)
The webspace for this project is kindly provided by the Perisic
Guesthouse (www.perisic.com).