You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general-cvs@xml.apache.org by Tasso Angelidis <ta...@trustmarque.ca> on 2004/11/23 20:52:14 UTC

XML RPC NoSuchMethodException.

It seems that the xmprpc list is not workin...

So I was wondering if someone here can answer thanks...

Am trying to use XML RPC with y servlet but I keep getting...
14:33:50,665 ERROR [TestService] org.apache.xmlrpc.XmlRpcException: java.lang.NoSuchMethodException: org.tmi.TestHandler.hello()

I have implemented the following in my servlet's doPost...

try
{
	XmlRpcServer xServer = new XmlRpcServer();
		
	xServer.addHandler("MyHandler", new TestHandler());
	System.out.println("Handler registered...");
			
	byte[] result = xServer.execute(request.getInputStream());
			
	response.setContentType ("text/xml");
	response.setContentLength (result.length );
			
	OutputStream out = response.getOutputStream();
	out.write (result);
	out.flush();
			
	xServer.removeHandler("MyHandler");
}
catch(Exception ex)
{
	System.out.println(ex.toString());
}


My handler...

public class TestHandler
{ 
	private String hello()
	{
		return("Hello World!");
    }

	private String nameTester(String first, String last)
	{
		return "Reversed: " + last + ", " + first;
    }
}

Client code

XmlRpcClient xmlrpc = new XmlRpcClient ("http://localhost:8080/myapp/XMLRPCServlet");
			
// Create the request parameters using user input
Vector params = new Vector();
//params.addElement(new String("Tasso"));
//params.addElement(new String("Angelidis"));

// Issue a request
Object result =	xmlrpc.execute("MyHandler.hello", params);







---------------------------------------------------------------------
To unsubscribe, e-mail: general-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: general-cvs-help@xml.apache.org