Thread: [phpxmlrpc-devel] Interoperability
Brought to you by:
ggiunta
From: Ryan H. <rh...@is...> - 2002-09-13 20:54:15
|
Hi, I am a user and rare contributor to the Apache group's XML-RPC library (http://xml.apache.org/xml-rpc). I am upgrading the HTTP client in our code and decided to test against a server that is running your code. Because the new HTTP client code is more strict in its interpretation of the server's response, we are unable to access XML-RPC servers using your code. A link to the posts to the xml-rpc-dev mailing list at apache, where you can find a list of other sites that exhibited similar behavior: http://marc.theaimsgroup.com/?l=rpc-dev&m=103176693403852&w=2 http://marc.theaimsgroup.com/?l=rpc-dev&m=103179721532649&w=2 What follows is a transcript of a session, which I executed manually. Cheers, Ryan Hoegg ISIS Networks $ telnet xmlrpc.usefulinc.com 80 Trying 80.87.131.124... Connected to usefulinc.com. Escape character is '^]'. POST /demo/server.php HTTP/1.1 User-Agent: ISIS Networks/0.2b (WinNT) Host: xmlrpc.usefulinc.com:80 Content-Type: text/xml Content-length: 211 <?xml version="1.0" encoding="ISO-8859-1"?><methodCall><methodName>examples.addtwo</methodName><params><param><value><int>12</int></value></param><param><value><int>11</int></value></param></params></methodCall> HTTP/1.1 200 OK Date: Wed, 11 Sep 2002 17:17:29 GMT Server: Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.2.2 X-Powered-By: PHP/4.2.2 Transfer-Encoding: chunked Content-Type: text/xml Content-length: 121 79 <?xml version="1.0"?> <methodResponse> <params> <param> <value><int>23</int></value> </param> </params> </methodResponse> 0 Connection closed by foreign host. $ |
From: Edd D. <ed...@us...> - 2002-09-18 07:45:27
|
Hey Ryan, looks like my Apache on xmlrpc.usefulinc.com is speaking HTTP/1.1, using the chunked encoding. ie. it's not actually wrong per HTTP, but it is wrong per the XML-RPC spec. I'll have to look into why this is happening, some config issue I suspect. Meanwhile it's trivial to set up a demo server on a machine of your own, just unpack the distribution and install the demo files. On Fri, 2002-09-13 at 21:53, Ryan Hoegg wrote: > Hi, >=20 > I am a user and rare contributor to the Apache group's XML-RPC library=20 > (http://xml.apache.org/xml-rpc). I am upgrading the HTTP client in our=20 > code and decided to test against a server that is running your code.=20 > Because the new HTTP client code is more strict in its interpretation=20 > of the server's response, we are unable to access XML-RPC servers using=20 > your code. A link to the posts to the xml-rpc-dev mailing list at=20 > apache, where you can find a list of other sites that exhibited similar=20 > behavior: > http://marc.theaimsgroup.com/?l=3Drpc-dev&m=3D103176693403852&w=3D2 > http://marc.theaimsgroup.com/?l=3Drpc-dev&m=3D103179721532649&w=3D2 >=20 > What follows is a transcript of a session, which I executed manually. >=20 > Cheers, > Ryan Hoegg > ISIS Networks >=20 > $ telnet xmlrpc.usefulinc.com 80 > Trying 80.87.131.124... > Connected to usefulinc.com. > Escape character is '^]'. > POST /demo/server.php HTTP/1.1 > User-Agent: ISIS Networks/0.2b (WinNT) > Host: xmlrpc.usefulinc.com:80 > Content-Type: text/xml > Content-length: 211 >=20 > <?xml version=3D"1.0"=20 > encoding=3D"ISO-8859-1"?><methodCall><methodName>examples.addtwo</methodN= ame><params><param><value><int>12</int></value></param><param><value><int>1= 1</int></value></param></params></methodCall>=20 >=20 > HTTP/1.1 200 OK > Date: Wed, 11 Sep 2002 17:17:29 GMT > Server: Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.2.2 > X-Powered-By: PHP/4.2.2 > Transfer-Encoding: chunked > Content-Type: text/xml > Content-length: 121 >=20 > 79 > <?xml version=3D"1.0"?> > <methodResponse> > <params> > <param> > <value><int>23</int></value> > </param> > </params> > </methodResponse> > 0 >=20 > Connection closed by foreign host. > $ >=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > phpxmlrpc-devel mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpxmlrpc-devel --=20 Edd Dumbill ----| phone: +44 1904 427740 fax: +44 8709 909625 |----- | Managing Editor, XML.com, XMLhack.com -- Chair, XML Europe 2002 | I PGP sign my email; more info at http://heddley.com/edd/pgp.html |
From: Edd D. <ed...@us...> - 2002-09-18 08:04:49
|
OK, I figured this out. Your request header has HTTP/1.1 in it. If that's what you send, that's what the web server expects you to speak! =20 The ones your program worked against worked because they don't implement HTTP/1.1. Change your request to HTTP/1.0, or implement HTTP/1.1 properly :) -- Edd On Wed, 2002-09-18 at 08:45, Edd Dumbill wrote: > Hey Ryan, looks like my Apache on xmlrpc.usefulinc.com is speaking > HTTP/1.1, using the chunked encoding. ie. it's not actually wrong per > HTTP, but it is wrong per the XML-RPC spec. I'll have to look into why > this is happening, some config issue I suspect. >=20 > Meanwhile it's trivial to set up a demo server on a machine of your own, > just unpack the distribution and install the demo files. >=20 > On Fri, 2002-09-13 at 21:53, Ryan Hoegg wrote: > > Hi, > >=20 > > I am a user and rare contributor to the Apache group's XML-RPC library=20 > > (http://xml.apache.org/xml-rpc). I am upgrading the HTTP client in our= =20 > > code and decided to test against a server that is running your code.=20 > > Because the new HTTP client code is more strict in its interpretation=20 > > of the server's response, we are unable to access XML-RPC servers using= =20 > > your code. A link to the posts to the xml-rpc-dev mailing list at=20 > > apache, where you can find a list of other sites that exhibited similar= =20 > > behavior: > > http://marc.theaimsgroup.com/?l=3Drpc-dev&m=3D103176693403852&w=3D2 > > http://marc.theaimsgroup.com/?l=3Drpc-dev&m=3D103179721532649&w=3D2 > >=20 > > What follows is a transcript of a session, which I executed manually. > >=20 > > Cheers, > > Ryan Hoegg > > ISIS Networks > >=20 > > $ telnet xmlrpc.usefulinc.com 80 > > Trying 80.87.131.124... > > Connected to usefulinc.com. > > Escape character is '^]'. > > POST /demo/server.php HTTP/1.1 > > User-Agent: ISIS Networks/0.2b (WinNT) > > Host: xmlrpc.usefulinc.com:80 > > Content-Type: text/xml > > Content-length: 211 > >=20 > > <?xml version=3D"1.0"=20 > > encoding=3D"ISO-8859-1"?><methodCall><methodName>examples.addtwo</metho= dName><params><param><value><int>12</int></value></param><param><value><int= >11</int></value></param></params></methodCall>=20 > >=20 > > HTTP/1.1 200 OK > > Date: Wed, 11 Sep 2002 17:17:29 GMT > > Server: Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.2.2 > > X-Powered-By: PHP/4.2.2 > > Transfer-Encoding: chunked > > Content-Type: text/xml > > Content-length: 121 > >=20 > > 79 > > <?xml version=3D"1.0"?> > > <methodResponse> > > <params> > > <param> > > <value><int>23</int></value> > > </param> > > </params> > > </methodResponse> > > 0 > >=20 > > Connection closed by foreign host. > > $ > >=20 > >=20 > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > phpxmlrpc-devel mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpxmlrpc-devel |
From: Ryan H. <rh...@is...> - 2002-09-19 18:22:01
|
Hi, Yoiu are right. This is an issue with XML-RPC 1.1. My changes to the XML-RPC client software are being done specifically to add this functionality. I was reminded and have verified that chunking breaks the XML-RPC spec because of the requirement for a valid Content-Length header. However, I still want to use it. I will report success or failure when I get this done. Ryan Hoegg ISIS Networks Edd Dumbill wrote: >OK, I figured this out. Your request header has HTTP/1.1 in it. If >that's what you send, that's what the web server expects you to speak! > >The ones your program worked against worked because they don't implement >HTTP/1.1. > >Change your request to HTTP/1.0, or implement HTTP/1.1 properly :) > >-- Edd > >On Wed, 2002-09-18 at 08:45, Edd Dumbill wrote: > > >>Hey Ryan, looks like my Apache on xmlrpc.usefulinc.com is speaking >>HTTP/1.1, using the chunked encoding. ie. it's not actually wrong per >>HTTP, but it is wrong per the XML-RPC spec. I'll have to look into why >>this is happening, some config issue I suspect. >> >>Meanwhile it's trivial to set up a demo server on a machine of your own, >>just unpack the distribution and install the demo files. >> >>On Fri, 2002-09-13 at 21:53, Ryan Hoegg wrote: >> >> >>>Hi, >>> >>>I am a user and rare contributor to the Apache group's XML-RPC library >>>(http://xml.apache.org/xml-rpc). I am upgrading the HTTP client in our >>>code and decided to test against a server that is running your code. >>> Because the new HTTP client code is more strict in its interpretation >>>of the server's response, we are unable to access XML-RPC servers using >>>your code. A link to the posts to the xml-rpc-dev mailing list at >>>apache, where you can find a list of other sites that exhibited similar >>>behavior: >>>http://marc.theaimsgroup.com/?l=rpc-dev&m=103176693403852&w=2 >>>http://marc.theaimsgroup.com/?l=rpc-dev&m=103179721532649&w=2 >>> >>>What follows is a transcript of a session, which I executed manually. >>> >>>Cheers, >>>Ryan Hoegg >>>ISIS Networks >>> >>>$ telnet xmlrpc.usefulinc.com 80 >>>Trying 80.87.131.124... >>>Connected to usefulinc.com. >>>Escape character is '^]'. >>>POST /demo/server.php HTTP/1.1 >>>User-Agent: ISIS Networks/0.2b (WinNT) >>>Host: xmlrpc.usefulinc.com:80 >>>Content-Type: text/xml >>>Content-length: 211 >>> >>><?xml version="1.0" >>>encoding="ISO-8859-1"?><methodCall><methodName>examples.addtwo</methodName><params><param><value><int>12</int></value></param><param><value><int>11</int></value></param></params></methodCall> >>> >>>HTTP/1.1 200 OK >>>Date: Wed, 11 Sep 2002 17:17:29 GMT >>>Server: Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.2.2 >>>X-Powered-By: PHP/4.2.2 >>>Transfer-Encoding: chunked >>>Content-Type: text/xml >>>Content-length: 121 >>> >>>79 >>><?xml version="1.0"?> >>><methodResponse> >>><params> >>><param> >>><value><int>23</int></value> >>></param> >>></params> >>></methodResponse> >>>0 >>> >>>Connection closed by foreign host. >>>$ >>> |
From: Ryan H. <rh...@is...> - 2002-09-29 18:31:39
|
Hi Edd, I've been working on this some more and have formed my latest theory as to what's gone wrong. I think both the Apache distribution and this one are breaking the HTTP 1.1 spec in RFC2616: You: - Messages MUST NOT include both a Content-Length header field and a non-identity transfer-coding. and - The Content-Length header field MUST NOT be sent if these two lengths are different (i.e., if a Transfer-Encoding header field is present). Us: - If the message does include a non-identity transfer-coding, the Content-Length MUST be ignored. and - If a message is received with both a Transfer-Encoding header field and a Content-Length header field, the latter MUST be ignored. -- Ryan Hoegg ISIS Networks Edd Dumbill wrote: >OK, I figured this out. Your request header has HTTP/1.1 in it. If >that's what you send, that's what the web server expects you to speak! > >The ones your program worked against worked because they don't implement >HTTP/1.1. > >Change your request to HTTP/1.0, or implement HTTP/1.1 properly :) > >-- Edd > > |
From: Edd D. <ed...@us...> - 2002-09-30 05:12:18
|
On Sun, 2002-09-29 at 19:31, Ryan Hoegg wrote: > Hi Edd, >=20 > I've been working on this some more and have formed my latest theory as=20 > to what's gone wrong. I think both the Apache distribution and this one=20 > are breaking the HTTP 1.1 spec in RFC2616: >=20 > You: > - Messages MUST NOT include both a Content-Length header field and a=20 > non-identity transfer-coding. > and > - The Content-Length header field MUST NOT be sent if these two lengths=20 > are different (i.e., if a Transfer-Encoding header field is present). Hmm, that makes it an interesting problem to solve this end -- as this behaviour is entirely dependent, as far as I can see, on the host web server. In my case, Apache 1.3. The only thing I could think to do would be to instruct users to ensure they force HTTP 1.0 on their XML-RPC endpoint (I don't even know if this is possible, I've only ever seen this enforced in Apache httpd via the BrowserMatch directive). > Us: > - If the message does include a non-identity transfer-coding, the=20 > Content-Length MUST be ignored. > and > - If a message is received with both a Transfer-Encoding header field=20 > and a Content-Length header field, the latter MUST be ignored. As obviously there appears to be no guarantee for you that servers using PHP XML-RPC will do the right thing, and I don't appear to be able to make a change to enforce it, then I think it's up to you... All suggestions for workarounds welcome. -- Edd=20 |