richardlev at gmail.com
Thu Sep 11 18:45:31 CEST 2008
On Sep 10, 2:04 pm, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> luigi.pai... at gmail.com schrieb:
> > On 9 Set, 17:55, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> >> I would go for a slightly different approach: make your server have a
> >> dispatch-method that delegates the calls to the underlying actual
> >> implementation. But *before* that happens, extract the information as
> >> above, and either
> >> - prepend it to the argument list
> >> - stuff it into threadlocal variables, and only access these if needed in
> >> your implementation.
> >> Diez
> > Are you suggesting me to overwrite the _dispatch(self, method, params)
> > method of SimpleXMLRPCDispatcher? I thought to this possibility, but
> > it only accepts "method" and "params" as arguments, so, as far as I
> > know, I have no way to get the user and host address to append.
> > Perhaps I've misunderstood your suggestion... in that case can you
> > post a short example?
> Ah, darn. Yes, you are right of course, the information itself is not
> available, as you don't have access to the request. I gotta ponder this
> a bit more.
Because he wants to insert parameters at the very start, he can
probably get away with modifying the xml directly. Just find the
position of the <params> (i think thats the tag) and insert the xml
you need after it. Its pretty dirty, but would work. The wire format
isn't that complicated.
More information about the Python-list