Added the patch mentioned in my last comment. But I realize now what should be done and have to admit that this is not the perfect solution.
I started to write a XmlRpcConnector and a XmlRpcMessageReceiver. The tricky thing is to write a more tolerant type converter so that "real" objects can be passed to the underlying services and not only HashMaps. Basically objects have to be translated to HashMaps and back.
This is what I have until now:
[code]
package org.mule.providers.xmlrpc;
import org.apache.xmlrpc.server.PropertyHandlerMapping;
import org.apache.xmlrpc.server.XmlRpcServer;
import org.apache.xmlrpc.server.XmlRpcServerConfigImpl;
import org.apache.xmlrpc.webserver.WebServer;
import org.mule.config.i18n.Message;
import org.mule.config.i18n.Messages;
import org.mule.providers.AbstractMessageReceiver;
import org.mule.providers.http.xmlrpc.converter.JibxTypeConverterFactory;
import org.mule.umo.UMOComponent;
import org.mule.umo.UMOException;
import org.mule.umo.endpoint.UMOEndpoint;
import org.mule.umo.lifecycle.InitialisationException;
import org.mule.umo.lifecycle.LifecycleException;
import org.mule.umo.provider.UMOConnector;
public class XmlRpcMessageReceiver extends AbstractMessageReceiver
{
public static final String XMLRPC_SERVLET_CONNECTOR_NAME= "_xmlrpcConnector";
private WebServer webServer;
public XmlRpcMessageReceiver(UMOConnector connector, UMOComponent component, UMOEndpoint endpoint)
throws InitialisationException
{
super(connector, component, endpoint);
}
public void doConnect() throws Exception
{
webServer = new WebServer(endpoint.getEndpointURI().getPort());
XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer();
PropertyHandlerMapping phm = new PropertyHandlerMapping();
//phm.setAuthenticationHandler(arg0);
//phm.setRequestProcessorFactoryFactory(arg0);
phm.setTypeConverterFactory(new MoreTolerantTypeConverterFactory());
xmlRpcServer.setHandlerMapping(phm);
phm.addHandler("Service", getComponent().getClass());
XmlRpcServerConfigImpl serverConfig = (XmlRpcServerConfigImpl)xmlRpcServer.getConfig();
serverConfig.setEnabledForExtensions(true); // TODO: configuration
serverConfig.setContentLengthOptional(false); // TODO: configuration
}
public void doDisconnect() throws Exception
{
}
protected void doDispose()
{
}
public void doStart() throws UMOException
{
try
{
webServer.start();
}
catch (Exception e)
{
throw new LifecycleException(new Message(Messages.FAILED_TO_START_X, "XML-RPC Http Receiver"), e, this);
}
}
public void doStop() throws UMOException
{
try
{
webServer.shutdown();
}
catch (Exception e)
{
throw new LifecycleException(new Message(Messages.FAILED_TO_STOP_X, "XML-RPC Http Receiver"), e, this);
}
}
}
[/code]
The interesting part starts - as I understand it - in the line "phm.setTypeConverterFactory(new MoreTolerantTypeConverterFactory());". For "simple" services (method parameters only have basic types or HashMaps as input/output values) this could already work (didn't try it though; this is just an idea).
Is this the way to go? Did I miss anything (I left the XmlRpcConnector, because the necessary code seems to be quite straight forward)?
Version 3.0 has now been officially released (almost a complete rewrite). They are using m2 build, so that part is easy at least: http://www.ibiblio.org/maven2/org/apache/xmlrpc/xmlrpc/3.0/