I finally found how to do it, so if anyone is interested, here is how I did it:
I created a "Custom data type", as described in the section of the same name here: http://ws.apache.org/xmlrpc/advanced.html
I also had to look at the sources of org.apache.xmlrpc.serializer.StringSerializer and org.apache.xmlrpc.common.TypeFactoryImpl (found on GrepCode here: http://grepcode.com/file/repo1.maven.org/maven2/org.apache.xmlrpc/xmlrpc-common/3.1.3/org/apache/xmlrpc/common/TypeFactoryImpl.java#TypeFactoryImpl.0STRING_SERIALIZER)
I had to create two class:
MyStringSerializer:
import org.apache.xmlrpc.serializer.*;<br>
import org.xml.sax.ContentHandler;<br>
import org.xml.sax.SAXException;
public class MyStringSerializer extends TypeSerializerImpl {
// Tag name of an string.
public static final String STRING_TAG = "string";
public void write(ContentHandler pHandler, Object pObject) throws SAXException {
write(pHandler, STRING_TAG, pObject.toString());
}
}
MyTypeFactory (methode to call instead of TypeFactoryImpl):
import org.apache.xmlrpc.common.TypeFactoryImpl;<br>
import org.apache.xmlrpc.common.XmlRpcController;<br>
import org.apache.xmlrpc.common.XmlRpcStreamConfig;<br>
import org.apache.xmlrpc.serializer.TypeSerializer;<br>
import org.xml.sax.SAXException;<br>
public class MyTypeFactory extends TypeFactoryImpl {
public MyTypeFactory(XmlRpcController pController) {
super(pController);
}
public TypeSerializer getSerializer(XmlRpcStreamConfig pConfig, Object pObject) throws SAXException {
if (pObject instanceof String){
return new MyStringSerializer();
}else{
return super.getSerializer(pConfig, pObject);
}
}
}