You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by Gam <ga...@fastmail.fm> on 2007/10/10 07:16:48 UTC

Migration from xmlrpc 2 to 3

Dear all,
I'm writing to make a request to the development team of xmlrpc.
As mention that the WebServer class is very popular, I think the  
following scenario is shared by many of your users.

Indeed, I have been using the Apache implementation of xmlrpc v2  
successfully for many projects I'm responsible of. It's the  
simplicity of XML-RPC that makes his power and beauty. I'm using it  
entirely as a communication bridge between php code on a web server  
and some distributed specialized mini java servers (using the built- 
in server).
I think the version 2 captured the simplicity of XML-RPC. Being a  
complete newbie, I went to the project website and read this line:
addHandler (String name, Object handler);
All I had to do is make an interface that my object implements, send  
the interface to the php programmers and add my object to the builtin  
server with this very line.

As a practice, if I need to use a framework or a library again, I'll  
always check if a new version is available and take the opportunity  
of upgrading my projects to it as soon as they need either  
maintenance update or major upgrade.

I was excited to see xmlrpc 3 released and started to use it. Of  
course, my code stopped compiling and I started to apply the changes  
you recommend on your website.
Then I stumbled, as many others, on:
phm.addHandler(java.lang.String pKey, java.lang.Class pClass)
mmm, I have an object... not a class.
it might not sound as bad as it is, but this little change means a  
lot of work on the user side. Basically, I had to create an extra  
class that merely has a static reference to the object I previously  
registered with xmlrpc 2 and for each public methods of the interface  
I invoke the same method on the static object... I can afford to do  
this because I made sure that my object could deal with multi-threads  
(which is why your new approach makes sense).
Being not satisfied by this solution (that felt like a hack) and  
because I'm always trying to create code as elegant as possible I  
started to dig into the project classes and this mailing list  
messages were (of course) several people asked the same question as  
me. The answers I gathered so far to solve the problem and use an  
object as a handler are:
- Create your own handler mapping. Or your own  
RequestProcessorFactoryFactory.
- it is suggested that you overwrite the XmlRpcHandlerMapping, if you  
want your own implementation of XmlRpcHandler.

Honestly, I tried for a few hours, digging deeper and deeper in the  
project. The problem is I'm not sure that what I'm doing is the right  
way (probably a mapping between classnames and initialized,  
instantiated objects) because I don't feel I have a deep  
understanding of the whole project.
I think it will help many users if your team could create this very  
useful class.
Therefore, my request is:
- to create and add to the project a class tentatively called  
"ObjectHandlerMapping" implementing XmlRpcHandlerMapping that let us  
add object as handler, similar to the v2 way.
- add a paragraph on the project website that talks specifically  
about this issue (Migration from version 2) explaining the problem  
and the solutions.

Thank you very much for your attention,
Continue the good work,
Cheers,
Gam

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


Re: Migration from xmlrpc 2 to 3

Posted by Radek Maciaszek <ra...@openads.org>.
Second to that. I spent half a day trying to figure out how to add
objects there. I needed to integrate XML-RPC3 with Spring. Eventually
one developer from my team managed to do this somehow but it was quite
a challenge indeed.

Radek

On 10/10/07, Gam <ga...@fastmail.fm> wrote:
> I'm writing to make a request to the development team of xmlrpc.
> As mention that the WebServer class is very popular, I think the
> following scenario is shared by many of your users.

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org