[mod_python] ZSI and mod_python

Jim Gallacher jpg at jgassociates.ca
Sat Aug 12 10:51:21 EDT 2006


Without knowing *anything* beyond a quick google to find out what the
heck ZSI is, is it possible that prepending the private functions with
an underscore might do the trick? eg def _average()?

No need to respond to this message on the mod_python list, because I
really have no clue about ZSI. :)

Jim

justind wrote:
> I posted on the ZSI board to, thought I better here just to cover all
> the bases.
> 
> Has anyone used ZSI with mod_python? If so, there is an example of how
> to use ZSI with mod_python in ZSI's documentation.
> 
> This feels  like a "I'm being stupid and forgetting/overlooking
> something obvious" type of problem.
> 
> From the example below, there is a module called MyHandler that has 3
> functions (hello,echo and average). You expose these functions through
> the dispatch.AsHandler() function in the mod_python code.
> Suppose that I only wanted to expose the hello and echo functions, but
> not the average function. I want to keep the average function in the
> module because some other function(s) I will make later will use it.
> 
> (Section 2.1.3).
> 
> The following is a complete example of a simple handler. The soap
> operations are implemented in the MyHandler module:
> 
> def hello():
>    return "Hello, world"
> 
> def echo(*args):
>    return args
> 
> def average(*args):
>    sum = 0
>    for i in args: sum += i
>    return sum / len(args)
> 
> Dispatching from within mod_python is achieved by passing the
> aforementined MyHandler module to |dispatch.AsHandler()|. The following
> code exposes the operations defined in MyHandler via SOAP:
> 
> from ZSI import dispatch
> from mod_python import apache
> 
> import MyHandler
> mod = __import__('encodings.utf_8', globals(), locals(), '*')
> mod = __import__('encodings.utf_16_be', globals(), locals(), '*')
> 
> def handler(req):
>    dispatch.AsHandler(modules=(MyHandler,), request=req)
>    return apache.OK
> 
> 
> 
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
> 



More information about the Mod_python mailing list