Hello,

 

I am testing the simple example from 

 

http://www.tutorialspoint.com/xml-rpc/xml_rpc_examples.htm

 

using Eclipse. But, I could not get the server code compiled as it can
not find 

WebServer.addHandler() method.   See the code below.

 

Am I missing something here? any suggestion is very appreciated.

 

Regards

 

Xiaofeng 

 

 

import org.apache.xmlrpc.*;

import org.apache.xmlrpc.webserver.WebServer;

 

 

public class JavaServer 

{ 

      public Integer sum(int x, int y) 

      {

            return new Integer(x+y);

      }

      public static void main (String [] args) 

      {

            try 

            {

                  System.out.println("Attempting to start XML-RPC
Server...");

                  WebServer server = new WebServer(8080);

                  server.addHandler("sample", new JavaServer());

                  server.start();

                  System.out.println("Started successfully.");

                  System.out.println("Accepting requests. (Halt program
to stop.)");

            } 

            catch (Exception exception) 

            {

                  System.err.println("JavaServer: " + exception);

            }

      }

}

 


-- 
Scanned by iCritical.

Reply via email to