XML-RPC - instance

M

Manuel Huesser

Currently it's possible to register a single functions or a an instance in
the standard XML-RPC library. Is there a possibility to refer to
a different instance, like in a session. Should be possible with HTTP/1.1,
but I haven't an idea.

If not with XML-RPC, are there other ways.

Thanks
 
B

Brian Quinlan

Manuel said:
Currently it's possible to register a single functions or a an instance in
the standard XML-RPC library. Is there a possibility to refer to
a different instance, like in a session. Should be possible with HTTP/1.1,
but I haven't an idea.

Could you be more specific? It is possible to do method dispatch pretty
much any way that you want; is that the functionality that you are
looking for?

Cheers,
Brian
 
G

Graham Dumpleton

Manuel Huesser said:
Currently it's possible to register a single functions or a an instance in
the standard XML-RPC library. Is there a possibility to refer to
a different instance, like in a session. Should be possible with HTTP/1.1,
but I haven't an idea.

If not with XML-RPC, are there other ways.

With the simple XML-RPC server that is provided with Python, most people
probably do this by having each method which is to operate on an instance,
to require a first parameter which identifies the instance to use.

Another approach which can be used is not necessarily straight forward
with the simple XML-RPC server included with Python. That is, for
different instances of a service or object which you want to manipulate
being referenced under a different URL. You should be able to do it, but you
would have to override the method dispatch routines to look at the URL
and use it as the basis of selecting some different set of methods or objects
against which the request is executed.

I prefer the latter approach of using different URLs to identify different
fixed services or transient services related to a session. The approach
of using scoping within the method name to identify different services
under the one URL doesn't really cut it for complicated systems.

Although not using the standard Python XML-RPC server, and also not
pure Python for that matter, you might look at the following Python
Cookbook example for an example of how URLs can be used to identify
information pertaining to different sessions.

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81613

The example uses different URLs for different database cursor instances.
The underlying framework is flexible enough that in this case the cursor
created for that specific session can be made to expire after a set period
of inactivity as well.

Echoing what another poster said, you would need to clarify perhaps
what you are trying to do.
 
M

Manuel Huesser

Could you be more specific? It is possible to do method dispatch pretty
much any way that you want; is that the functionality that you are
looking for?

Yep there are classes where you can do that in any order, but there are
classes where you can't call methods in any order, too.

More specific?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top