Hello!

We need a servlet which handles XML-RPC requests from a third party. The 
third-party XMLRPC-API had already existed before, meaning the format of these 
incoming requests is fixed and we must adapt to them.

Unfortunately, these requests only contain a methodName and no handler name. 
Analogue to the calculator-example, the requests would only contain "add" as 
method name, and no "Calculator.add". To be more precise:

This is what I could handle without problems right now:
<?xml 
version="1.0"?><methodCall><methodName>Calculator.Add</methodName><params></params></methodCall>

This is what I have to live with, though:
<?xml 
version="1.0"?><methodCall><methodName>Add</methodName><params></params></methodCall>

How can I adapt the XmlRpcServlet so that it "forwards" these requests to the 
right handler class ("Calculator")?

I already tried to add a handler with a empty "pKey"
(
PropertyHandlerMapping phm = new PropertyHandlerMapping();
phm.addHandler("", ex.ample.com.Calculator);
).
That just lead to another error ("org.apache.xmlrpc.XmlRpcException: No such 
handler: Add") when I tried to send a request to the XmlRpcServlet.

I also read that in XML-RPC 2 it was possible to use a DefaultHandlerMapping. 
Though, it seems this DefaultHandlerMapping has not been included in the latest 
release, which I would like to use. Besides, neither the provided information 
on the XMLRPC2- site nor other sources could really help me to produce some 
working solution - not even with XML-RPC 2.

I'd be glad to get some example code in the answer.

Kind regards,
Yves Gänßinger

Reply via email to