[Zope-dev] SOAP Support for ZOPE
John Ziniti
jziniti at speakeasy.org
Tue Dec 14 15:28:08 EST 2004
Aruna Kathiria wrote:
> I did some work regarding SOAP support on ZOPE and published this
> document on zope.org.
> The link for this document is
> http://zope.org/Members/arunacgx/SOAP%20Support%20on%20Zope/file_view
>
> I would like to get feedback/suggestion regarding this document.
One preliminary suggestion:
In the section entitled "3.2.4 Correcting HTTPRequest.py", I would
suggest that instead of having users edit the file, you could
instead distribute your product as a "Monkey Patch" Zope Product
that overrides the HTTPRequest.processInputs method with your
altered version.
You can see an example of this in the XmlFix Product attached
to the followign mailing-list item:
http://mail.zope.org/pipermail/zope/2004-June/151497.html
Basically you would do this:
<code>
### Import the HTTPRequest object we want to alter
from ZPublisher.HTTPRequest import HTTPRequest
### Save the *old* processInputs method
def initialize(context):
HTTPRequest._realProcessInputs = HTTPRequest.processInputs
HTTPRequest.processInputs = processInputs
### Write a new processInputs method that does what we want
def processInputs(self, *args, **kw):
if myProductShouldHandleThisRequest:
do_stuff()
else:
### Hand over to the original processInputs
return self._realProcessInputs(*args, **kw)
</code>
Since this is a Zope Product, the above code would run once
every time you started Zope, and is much more "portable" between
Zope installations than having the admin edit code.
Hope that helps,
John Ziniti
More information about the Zope-Dev
mailing list