Apache XML-RPC adapter continued

by Dejan Bosanac

In the previous post I showed how you can make a Spring wrapper around the WebServer object and thus configure it easily in Spring-based applications. This solution is good for standalone applications that use Spring as a configuration mechanism.

But if you are using Spring MVC to develop web applications you probably don't want to start another web server to handle XML-RPC calls. Instead, we have to find a way to configure XML-RPC to work with the web server that hosts our application and again to use our beans as XML-RPC handlers.

On the first look I thought that the easiest way to achieve this is to wrap the XmlRpcServlet (available from version 3.0 on) in the ServletWrappingController. But when I started looking at the code I found a solution that is much more simple and elegant.


2006-10-22 22:07:28
I assume this is version 2.0, since XmlRpcServer#addHandler doesn't exist in 3.0.
Uli Romahn
2006-12-08 14:49:19
Trejkaz is absolutely correct - the above example would not work with version 3.0. And this is not just because the addHandler() method doesn't exist, but because one is not supposed to use the XmlRpcServer class directly anymore. Instead, things have become more simple and complicated at the same time. The xml-rpc server now has its own IoC paradigm and configuring a server is as easy as creating a properties file containing the handlers and an entry in the web.xml. However, wrapping it into a Spring controller is also not too complicated - just much different.
I might create a blog about that on my page if I have the time to do this and add the URL to this blog as a comment later.