xml-rpc changes between 2.7.0 and 2.7.3 ??
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I had a client that used to work on 2.7.0, and now doesn't on 2.7.3. The problem would appear to be that it's not substituting the xmlrpc.Response class for a GET request on a text/xml content type and therefore just delegating to the str() function instead of wrapping it in the xml-rpc xml response tags. I'm a little confused about this, as this only appears to happen in HTTPRequest::processInputs which didn't seem to be invoked for my xml-rpc call anyway ... tcpdump follows for the sceptics ... j.. 08:05:04.901469 IP mistress.balclutha.org.34257 > mistress.balclutha.org.zope: P 1:456(455) ack 1 win 32767 <nop,nop,timestamp 225097763 225097723> E.....@.@.)..............W.....x........... j..GET /last-bastion.net/junk/rpm/RPC2/$RHN/mail/listPackages/1 HTTP/1.1 Host: localhost:8080 Accept-Encoding: identity x-client-version: 1 x-transport-info: Extended Capabilities Transport (C) Red Hat, Inc (version 1.40) x-up2date-version: user-agent: rhn.rpclib.py/$Revision: 1.40 $ x-rhn-transport-capability: follow-redirects=1 x-rhn-auth-channels: ['mail', '1'] content-type: text/xml x-info: RPC Processor (C) Red Hat, Inc (version 1.44) 08:05:04.901498 IP mistress.balclutha.org.zope > mistress.balclutha.org.34257: . ack 456 win 32767 <nop,nop,timestamp 225097763 225097763> E..4i.@.@..>...............x.W............. j.# 08:05:04.910507 IP mistress.balclutha.org.zope > mistress.balclutha.org.34257: P 1:871(870) ack 456 win 32767 <nop,nop,timestamp 225097772 225097763> E...i.@.@..................x.W............. j.#HTTP/1.1 200 OK Server: Zope/(Zope 2.7.3b1-0, python 2.3.3, linux2) ZServer/1.1 Plone/2.0.4 Date: Mon, 11 Oct 2004 22:05:04 GMT Content-Length: 690 Content-Type: text/plain [['EnchantMail', '2.0.0', '4', '', 'i386', '121577', 'mail'], ['courier', '0.47', '1', '', 'i386', '4172641', 'mail'], ['courier-imapd', '0.47', '1', '', 'i386', '400894', 'mail'], ['courier-ldap', '0.47', '1', '', 'i386', '109401', 'mail'], ['courier-maildrop', '0.47', '1', '', 'i386', '1178663', 'mail'], ['courier-maildrop-wrapper', '0.47', '1', '', 'i386', '0', 'mail'], ['courier-mlm', '0.47', '1', '', 'i386', '250756', 'mail'], ['courier-pop3d', '0.47', '1', '', 'i386', '115327', 'mail'], ['courier-smtpauth', '0.47', '1', '', 'i386', '257063', 'mail'], ['courier-webadmin', '0.47', '1', '', ~ 'i386', '22047', 'mail'], ['courier-webmail', '0.47', '1', '', 'i386', '970798', 'mail']]08:05:04.910534 IP mistress.balclutha.org.34257 > mistress.balclutha.org.zope: . ack 871 win 32767 <nop,nop,timestamp 225097772 225097772> E..4..@.@.+..............W...........Y..... -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFBawY2CfroLk4EZpkRAmtFAKDVLmORsmw6LacIUizLNn111t1J+wCffq7w 3Pbm2RrCvIFKlkxuUg1BDaA= =MbC0 -----END PGP SIGNATURE-----
According to the CHANGES.txt there were no changes to XMLRPC. xmlrpclib.py was removed before 2.7 final because it is part of the Python distro. Looking at your debug output I have no idea what it will show us. Andreas --On Dienstag, 12. Oktober 2004 8:16 Uhr +1000 Alan Milligan <alan@balclutha.org> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
I had a client that used to work on 2.7.0, and now doesn't on 2.7.3.
The problem would appear to be that it's not substituting the xmlrpc.Response class for a GET request on a text/xml content type and therefore just delegating to the str() function instead of wrapping it in the xml-rpc xml response tags.
I'm a little confused about this, as this only appears to happen in HTTPRequest::processInputs which didn't seem to be invoked for my xml-rpc call anyway ...
tcpdump follows for the sceptics ...
j.. 08:05:04.901469 IP mistress.balclutha.org.34257 > mistress.balclutha.org.zope: P 1:456(455) ack 1 win 32767 <nop,nop,timestamp 225097763 225097723> E.....@.@.)..............W.....x........... j..GET /last-bastion.net/junk/rpm/RPC2/$RHN/mail/listPackages/1 HTTP/1.1 Host: localhost:8080 Accept-Encoding: identity x-client-version: 1 x-transport-info: Extended Capabilities Transport (C) Red Hat, Inc (version 1.40) x-up2date-version: user-agent: rhn.rpclib.py/$Revision: 1.40 $ x-rhn-transport-capability: follow-redirects=1 x-rhn-auth-channels: ['mail', '1'] content-type: text/xml x-info: RPC Processor (C) Red Hat, Inc (version 1.44)
08:05:04.901498 IP mistress.balclutha.org.zope > mistress.balclutha.org.34257: . ack 456 win 32767 <nop,nop,timestamp 225097763 225097763> E..4i.@.@..>...............x.W.............
j.# 08:05:04.910507 IP mistress.balclutha.org.zope > mistress.balclutha.org.34257: P 1:871(870) ack 456 win 32767 <nop,nop,timestamp 225097772 225097763> E...i.@.@..................x.W............. j.#HTTP/1.1 200 OK Server: Zope/(Zope 2.7.3b1-0, python 2.3.3, linux2) ZServer/1.1 Plone/2.0.4 Date: Mon, 11 Oct 2004 22:05:04 GMT Content-Length: 690 Content-Type: text/plain
[['EnchantMail', '2.0.0', '4', '', 'i386', '121577', 'mail'], ['courier', '0.47', '1', '', 'i386', '4172641', 'mail'], ['courier-imapd', '0.47', '1', '', 'i386', '400894', 'mail'], ['courier-ldap', '0.47', '1', '', 'i386', '109401', 'mail'], ['courier-maildrop', '0.47', '1', '', 'i386', '1178663', 'mail'], ['courier-maildrop-wrapper', '0.47', '1', '', 'i386', '0', 'mail'], ['courier-mlm', '0.47', '1', '', 'i386', '250756', 'mail'], ['courier-pop3d', '0.47', '1', '', 'i386', '115327', 'mail'], ['courier-smtpauth', '0.47', '1', '', 'i386', '257063', 'mail'], ['courier-webadmin', '0.47', '1', '', ~ 'i386', '22047', 'mail'], ['courier-webmail', '0.47', '1', '', 'i386', '970798', 'mail']]08:05:04.910534 IP mistress.balclutha.org.34257 > mistress.balclutha.org.zope: . ack 871 win 32767 <nop,nop,timestamp 225097772 225097772> E..4..@.@.+..............W...........Y.....
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFBawY2CfroLk4EZpkRAmtFAKDVLmORsmw6LacIUizLNn111t1J+wCffq7w 3Pbm2RrCvIFKlkxuUg1BDaA= =MbC0 -----END PGP SIGNATURE----- _______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Hi, Am Di, den 12.10.2004 schrieb Alan Milligan um 0:16:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
I had a client that used to work on 2.7.0, and now doesn't on 2.7.3.
The problem would appear to be that it's not substituting the xmlrpc.Response class for a GET request on a text/xml content type and therefore just delegating to the str() function instead of wrapping it in the xml-rpc xml response tags.
I'm a little confused about this, as this only appears to happen in HTTPRequest::processInputs which didn't seem to be invoked for my xml-rpc call anyway ...
tcpdump follows for the sceptics ...
j.. 08:05:04.901469 IP mistress.balclutha.org.34257 > mistress.balclutha.org.zope: P 1:456(455) ack 1 win 32767 <nop,nop,timestamp 225097763 225097723> E.....@.@.)..............W.....x........... j..GET /last-bastion.net/junk/rpm/RPC2/$RHN/mail/listPackages/1 HTTP/1.1 Host: localhost:8080 Accept-Encoding: identity x-client-version: 1 x-transport-info: Extended Capabilities Transport (C) Red Hat, Inc (version 1.40) x-up2date-version: user-agent: rhn.rpclib.py/$Revision: 1.40 $ x-rhn-transport-capability: follow-redirects=1 x-rhn-auth-channels: ['mail', '1'] content-type: text/xml x-info: RPC Processor (C) Red Hat, Inc (version 1.44)
Your log is a bit confusing maybe you better use tcpflow for dumping. But what is clearly seen is the GET request. I wonder how this ever was supposed to work since XML-RPC requires an entidy body for the message (which is in XML). You can compare with RFC2616 - there is no entidy body in GET. Your client needs to use POST. I suspect then it should work. Regards Tino
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Tino Wildenhain wrote: |> |>I had a client that used to work on 2.7.0, and now doesn't on 2.7.3. |> |>The problem would appear to be that it's not substituting the |>xmlrpc.Response class for a GET request on a text/xml content type and |>therefore just delegating to the str() function instead of wrapping it |>in the xml-rpc xml response tags. |> | I wonder how this ever was supposed to work since | XML-RPC requires an entidy body for the message (which is | in XML). You can compare with RFC2616 - there is no | entidy body in GET. Your client needs to use POST. | I suspect then it should work. | Ok, I now more fully understand the subtlety of this explanation. What happened here is that in cgi.py's FieldStorage class, since this is a GET request, it completely ignores the CONTENT_TYPE environment and sets the content-type header to x-www-form-urlencoded. According to Dave Winer's spec at http://www.xmlrpc.com/spec, XML-RPC is supposed to be HTTP-POST based, where this issue is fully resolved. I have implemented this GET 'Extension' with this patch. I appreciate that supporting 'unofficial' extensions to protocols is not something we want to encourage, but is there any chance of getting this patch into zope core (ever)? Cheers, Alan -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFBbIWLCfroLk4EZpkRAlX3AKDI5Cdb6CUfdkqtSrEllfZeEGEnMwCdHJN0 78EIcOvXOD2H4imuI2NQOxw= =H+yj -----END PGP SIGNATURE-----
Hi, Am Mi, den 13.10.2004 schrieb Alan Milligan um 3:31:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Tino Wildenhain wrote:
|> |>I had a client that used to work on 2.7.0, and now doesn't on 2.7.3. |> |>The problem would appear to be that it's not substituting the |>xmlrpc.Response class for a GET request on a text/xml content type and |>therefore just delegating to the str() function instead of wrapping it |>in the xml-rpc xml response tags. |>
| I wonder how this ever was supposed to work since | XML-RPC requires an entidy body for the message (which is | in XML). You can compare with RFC2616 - there is no | entidy body in GET. Your client needs to use POST. | I suspect then it should work. |
Ok, I now more fully understand the subtlety of this explanation.
What happened here is that in cgi.py's FieldStorage class, since this is a GET request, it completely ignores the CONTENT_TYPE environment and sets the content-type header to x-www-form-urlencoded.
According to Dave Winer's spec at http://www.xmlrpc.com/spec, XML-RPC is supposed to be HTTP-POST based, where this issue is fully resolved.
I have implemented this GET 'Extension' with this patch.
I appreciate that supporting 'unofficial' extensions to protocols is not something we want to encourage, but is there any chance of getting this patch into zope core (ever)?
-1 by me. Go and fix the broken client instead. I wonder who came to such a crazy idea to even think about sending a body with GET. Regards Tino
Alan Milligan wrote at 2004-10-13 11:31 +1000:
... I appreciate that supporting 'unofficial' extensions to protocols is not something we want to encourage, but is there any chance of getting this patch into zope core (ever)?
I hope not... -- Dieter
participants (4)
-
Alan Milligan -
Andreas Jung -
Dieter Maurer -
Tino Wildenhain