[Zope] XMLRPC accessing Zope DTML/SQL methods

Dieter Maurer dieter@handshake.de
Tue, 7 Nov 2000 22:34:30 +0100 (CET)


Mayers, Philip J writes:
 > I have an SQL query method backed by a persistent DB connection. I want to
 > call that method over XMLRPC remotely. How do I do that? Namely, how do I
 > pass named arguments to the SQL method?
I have looked at XMLRPC some time ago, but I forgot most details:

  If XMLRPC supports keyword (i.e. named) parameters,
  then Zope will handle the parameter passing transparently
  for you. You must use the same keyword parameters your
  have defined in the ZSQL method.

  If XMLRPC supports only positional (i.e. unamend) parameters
  then you must use as a wrapper a method type
  that supports positional parameters (Python method/External method).

 > Also, I did some simple External Method examples, and acquisition doesn't
 > seem to work as advertised: This:
 > 
 > def testf(self, REQUEST):
 >         return self.index_html()
 > 
 > Gives an error "standard_html_header not found". What's going on?
When you call DTML objects yourself, you must pass the context
explicitely:

	   return self.index_html(self,REQUEST)



Dieter