Subject: | simple_request failing |
All the tests (t/*.t) pass but when I start a server process (using RPC::XML::Server) on one xterm screen and then start a client (using RPC::XML::Client) on another xterm, simple_request fails with this error:
syntax error at line 1, column 0, byte 0 at /usr/local/share/perl/5.8.4/RPC/XML/Client.pm line 346 at client1.pl line 33.
The error is from the xml parser complaining that the string being parsed is faulty
I printed the string prior to calling the parser and this is what it contains:
Data: Server: libwww-perl-daemon/1.36
Accept: text/xml
Accept-Encoding: deflate
Content-Length: 159
Content-Type: text/xml
RPC-Encoding: XML-RPC
RPC-Server: RPC::XML::Server/1.42
<?xml version="1.0" encoding="us-ascii"?><methodResponse><params><param><value><string>RPC::XML::Server/1.42</string></value></param></params></methodResponse>
which is indeed not valid XML. I inserted the following line prior to line 346:
$data =~ s/^.*?\r?\n\r?\n//s; #strip header
(I have no idea why the header is stripped in the test scripts but not in
an ordinary script.)
And now I am able to actually use RPC::XML::Client. And all the test scripts continue to pass. Whatever fault this is showing up is not being tested for in t/*.t. Probably something to do with the same process starting the client and the server in the test scripts but I can't see what it is.