Re: [Zope-dev] XML-RPC External Method bug
Nathan 'Nato' Uno wrote at 2003-1-8 16:53 -0600: On Wed, 2003-01-08 at 15:57, Dieter Maurer wrote: I use XML-RPC to call External Methods without problems. I use Zope 2.5.1. snip Can you send me the method description so that I can see the arg list? def startNewsletterProduction(self,mode,pid): and def finishNewsletterProduction(self,mode,errors,statistics): Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] XML-RPC External Method bug
You should file a collector issue re this and give a specific set of steps to exercise the bug. I corrected a seemingly similar bug recently. I assume you have tried this on the 2.6.1 beta? I don't think anything changed between 2.6.0 and 2.6.1 in this regard but you never know. I do know I changed things in there between 2.5.1 and 2.6.0. -Casey On Tuesday 07 January 2003 10:01 am, Nathan 'Nato' Uno wrote: Greetings! I've been working with some of my coworkers tracking a problem very similar to the one described in this thread: http://lists.zope.org/pipermail/zope-dev/2002-November/017922.html which is also outlined here: http://zope.nipltd.com/public/lists/zope-archive.nsf/ByKey/B9323F6D666D3D5C and I've found out some things which may be helpful in finding a better long-term solution. There appears to be a problem with the way that External Methods are inspected when called via XML-RPC. Specifically, mapply() doesn't know what arguments the external method is expecting, apparently because the 'func_defaults' attribute of the object doesn't seem to be set properly. Interestingly enough, if apply() is called then the external method is fully inspected (presumably because it's actually invoked), after which the external method call works properly via XML-RPC. Practically this means that when I invoke an external method via XML-RPC and pass the correct arguments, mapply() doesn't know what arguments the method is expecting, assumes (in essence) that it expects 0, and returns 'too many arguments' (where 1 0). However, if I invoke the external method with *no* arguments, mapply() assumes that everything is good and invokes apply(), which throws a TypeError (function expects at least 1 argument, 0 given). If I then invoke the method *again* with the proper arguments (i.e. I use exactly the same call I made the first time), then the object inspected by mapply() has the 'func_defaults' attribute correctly set and the method works properly. I've spent the better part of two days sprinkling LOG() calls throughout ZPublisher, so I can give some more detailed information if anyone's really interested. In the meantime, I temporarily hacked my local copy of mapply() to invoke apply(object, '') for every call, forcing the method to be properly inspected/cached/whatever, then caught the TypeError and moved on to the rest of mapply. This worked for me, causing all of my XML-RPC calls to function properly, but concerned me because it opened the possibility of apply(object, '') being called successfully twice for an object that takes no arguments. So I backed that out and hacked by local copy of publish() instead, calling apply(object, '') for any object whose path matches my external methods. This should work for us without any unintended side effects, but I'd obviously like to be involved with a long-term solution that would benefit the whole community. Please let me know if there's any more information I can give or anything else I can contribute. I'd be glad to do more legwork, but I got bogged down last night trying to unravel the inspection/creation of external method objects, and can't really proceed effectively without some pointers on how that stuff works and where to poke around. Thanks very much, Nathan 'Nato' Uno Hostway Corporation [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] XML-RPC External Method bug
On Wed, 2003-01-08 at 15:57, Dieter Maurer wrote: Nathan 'Nato' Uno wrote at 2003-1-7 09:01 -0600: ... There appears to be a problem with the way that External Methods are inspected when called via XML-RPC. I use XML-RPC to call External Methods without problems. I use Zope 2.5.1. snip Can you send me the method description so that I can see the arg list? From what I can understand, it seems that certain types of argument lists *could* work - but I'd be interested to have a copy of your method (or a stub that was similar to your method) for further testing. I intend to: a) Test 2.6.0 and 2.6.1b1 as well (I've only tested with 2.5.1) b) Create a (hopefully) reproducible methodology c) File a collector issue ... but work is bogging me down just now. Hopefully before the weekend. Thanks very much, Nathan 'Nato' Uno Hostway Corporation [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] XML-RPC External Method bug
Nathan 'Nato' Uno wrote at 2003-1-7 09:01 -0600: ... There appears to be a problem with the way that External Methods are inspected when called via XML-RPC. I use XML-RPC to call External Methods without problems. I use Zope 2.5.1. Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] XML-RPC External Method bug
Greetings! I've been working with some of my coworkers tracking a problem very similar to the one described in this thread: http://lists.zope.org/pipermail/zope-dev/2002-November/017922.html which is also outlined here: http://zope.nipltd.com/public/lists/zope-archive.nsf/ByKey/B9323F6D666D3D5C and I've found out some things which may be helpful in finding a better long-term solution. There appears to be a problem with the way that External Methods are inspected when called via XML-RPC. Specifically, mapply() doesn't know what arguments the external method is expecting, apparently because the 'func_defaults' attribute of the object doesn't seem to be set properly. Interestingly enough, if apply() is called then the external method is fully inspected (presumably because it's actually invoked), after which the external method call works properly via XML-RPC. Practically this means that when I invoke an external method via XML-RPC and pass the correct arguments, mapply() doesn't know what arguments the method is expecting, assumes (in essence) that it expects 0, and returns 'too many arguments' (where 1 0). However, if I invoke the external method with *no* arguments, mapply() assumes that everything is good and invokes apply(), which throws a TypeError (function expects at least 1 argument, 0 given). If I then invoke the method *again* with the proper arguments (i.e. I use exactly the same call I made the first time), then the object inspected by mapply() has the 'func_defaults' attribute correctly set and the method works properly. I've spent the better part of two days sprinkling LOG() calls throughout ZPublisher, so I can give some more detailed information if anyone's really interested. In the meantime, I temporarily hacked my local copy of mapply() to invoke apply(object, '') for every call, forcing the method to be properly inspected/cached/whatever, then caught the TypeError and moved on to the rest of mapply. This worked for me, causing all of my XML-RPC calls to function properly, but concerned me because it opened the possibility of apply(object, '') being called successfully twice for an object that takes no arguments. So I backed that out and hacked by local copy of publish() instead, calling apply(object, '') for any object whose path matches my external methods. This should work for us without any unintended side effects, but I'd obviously like to be involved with a long-term solution that would benefit the whole community. Please let me know if there's any more information I can give or anything else I can contribute. I'd be glad to do more legwork, but I got bogged down last night trying to unravel the inspection/creation of external method objects, and can't really proceed effectively without some pointers on how that stuff works and where to poke around. Thanks very much, Nathan 'Nato' Uno Hostway Corporation [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )