Link to home
Start Free TrialLog in
Avatar of oggiemc
oggiemcFlag for Ireland

asked on

xml-rpc java

Hello all,

I have a question with regards to an xml-rpc example i found on the web..Im getting the following error when i try to run the attached code:

The method addHandler(String, JavaServer) is undefined for the type WebServer

I am using apache-xmlrpc-3.1.3 and sure enough when i checked the api, no addHandler method exists for the WebServer class..Can someone help me

Open in new window

out here please?


package org.fergal;

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(80);
     server.addHandler("sample", new JavaServer());
     System.out.println("Started successfully.");
     System.out.println("Accepting requests. (Halt program to stop.)");
   } catch (Exception exception) {
     System.err.println("JavaServer: " + exception);

Open in new window

Avatar of girionis
Flag of Greece image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial