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 Markus Meyer <me...@mesw.de> on 2009/04/22 14:21:46 UTC

Renaming XML RPC functions

Hi everyone,

can I rename XML-RPC functions so they appear without the class name? 
For example, to execute the "add" function in the "Calculator" class 
from the tutorial, a XML-RPC client has to call "Calculator.add" instead 
of just "add". I need to implement a server which uses function names 
without the class name. Can I change this so the client only has to call 
"add"?

Thanks in advance!

Regards
Markus


Re: Renaming XML RPC functions

Posted by Alan Burlison <Al...@sun.com>.
Stanislav Miklik wrote:

> XmlRpcHandler:
> 
> java.lang.Object *execute*(XmlRpcRequest
> <http://ws.apache.org/xmlrpc/apidocs/org/apache/xmlrpc/XmlRpcRequest.html>
> pRequest)

There's a simplistic example here:

http://src.opensolaris.org/source/xref/website/auth/XMLRPCTests/src/org/opensolaris/auth/test/ssl/SimpleXmlRpcServer.java#150

-- 
Alan Burlison
--

Re: Renaming XML RPC functions

Posted by Stanislav Miklik <st...@gmail.com>.
Hi,

it is also possible to change on server side (if you want). You can define
your own "request handling" where you can implement mapping between xml rpc
calls and your code as you want. But maybe it would be easier to change the
client ;-)
see api:

XmlRpcServer :

public void *setHandlerMapping*(XmlRpcHandlerMapping
<http://ws.apache.org/xmlrpc/apidocs/org/apache/xmlrpc/server/XmlRpcHandlerMapping.html>
pMapping)

XmlRpcHandler:

java.lang.Object *execute*(XmlRpcRequest
<http://ws.apache.org/xmlrpc/apidocs/org/apache/xmlrpc/XmlRpcRequest.html>
pRequest)


Regards
Stano

On Thu, Apr 23, 2009 at 08:39, Markus Meyer <me...@mesw.de> wrote:

> James,
>
> thanks for answering. The simple reason is that the interface was defined
> like this. The client has already been written but the server has not. If
> this would not be possible, the interface definition would need to be
> adjusted and the client changed. The client is written in Python and with
> the "xmlrpclib" module in Python there is no such limitation.
>
>
> Markus
>
> James Dumay schrieb:
>
>  Oh sorry, I didn't read this correctly (thats what you get for emailing
>> when your up late).
>>
>> I don't think thats possible - any particular reason this is needed?
>>
>> James
>>
>> ----- Original Message -----
>> From: "Markus Meyer" <me...@mesw.de>
>> To: xmlrpc-dev@ws.apache.org
>> Sent: Wednesday, April 22, 2009 10:21:46 PM GMT +10:00 Canberra /
>> Melbourne / Sydney
>> Subject: Renaming XML RPC functions
>>
>> Hi everyone,
>>
>> can I rename XML-RPC functions so they appear without the class name? For
>> example, to execute the "add" function in the "Calculator" class from the
>> tutorial, a XML-RPC client has to call "Calculator.add" instead of just
>> "add". I need to implement a server which uses function names without the
>> class name. Can I change this so the client only has to call "add"?
>>
>> Thanks in advance!
>>
>> Regards
>> Markus
>>
>>
>>
>
>

Re: Renaming XML RPC functions

Posted by Markus Meyer <me...@mesw.de>.
James,

thanks for answering. The simple reason is that the interface was 
defined like this. The client has already been written but the server 
has not. If this would not be possible, the interface definition would 
need to be adjusted and the client changed. The client is written in 
Python and with the "xmlrpclib" module in Python there is no such 
limitation.


Markus

James Dumay schrieb:
> Oh sorry, I didn't read this correctly (thats what you get for emailing when your up late).
>
> I don't think thats possible - any particular reason this is needed?
>
> James
>
> ----- Original Message -----
> From: "Markus Meyer" <me...@mesw.de>
> To: xmlrpc-dev@ws.apache.org
> Sent: Wednesday, April 22, 2009 10:21:46 PM GMT +10:00 Canberra / Melbourne / Sydney
> Subject: Renaming XML RPC functions
>
> Hi everyone,
>
> can I rename XML-RPC functions so they appear without the class name? 
> For example, to execute the "add" function in the "Calculator" class 
> from the tutorial, a XML-RPC client has to call "Calculator.add" instead 
> of just "add". I need to implement a server which uses function names 
> without the class name. Can I change this so the client only has to call 
> "add"?
>
> Thanks in advance!
>
> Regards
> Markus
>
>   


Re: Renaming XML RPC functions

Posted by James Dumay <jd...@atlassian.com>.
Oh sorry, I didn't read this correctly (thats what you get for emailing when your up late).

I don't think thats possible - any particular reason this is needed?

James

----- Original Message -----
From: "Markus Meyer" <me...@mesw.de>
To: xmlrpc-dev@ws.apache.org
Sent: Wednesday, April 22, 2009 10:21:46 PM GMT +10:00 Canberra / Melbourne / Sydney
Subject: Renaming XML RPC functions

Hi everyone,

can I rename XML-RPC functions so they appear without the class name? 
For example, to execute the "add" function in the "Calculator" class 
from the tutorial, a XML-RPC client has to call "Calculator.add" instead 
of just "add". I need to implement a server which uses function names 
without the class name. Can I change this so the client only has to call 
"add"?

Thanks in advance!

Regards
Markus


Re: Renaming XML RPC functions

Posted by James Dumay <jd...@atlassian.com>.
Hey Markus,
I wrote a wrapper around the XML-RPC client for these purposes.

http://fagonfoss.com/blog/2009/02/consuming-xml-rpc-services-with-pojos/

Have a look at the following source to see how you can implement it:

http://svn.apache.org/repos/asf/archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/

Cheers
James

----- Original Message -----
From: "Markus Meyer" <me...@mesw.de>
To: xmlrpc-dev@ws.apache.org
Sent: Wednesday, April 22, 2009 10:21:46 PM GMT +10:00 Canberra / Melbourne / Sydney
Subject: Renaming XML RPC functions

Hi everyone,

can I rename XML-RPC functions so they appear without the class name? 
For example, to execute the "add" function in the "Calculator" class 
from the tutorial, a XML-RPC client has to call "Calculator.add" instead 
of just "add". I need to implement a server which uses function names 
without the class name. Can I change this so the client only has to call 
"add"?

Thanks in advance!

Regards
Markus