xml-rpc troubleshooting

Since a few days back I get the following error during an xml-rpc call:

Transport error:
no element found at line 1, column 0, byte -1 at /usr/lib/perl5/site_perl/5.8.8/RPC/XML/Client.pm line 365
-------------------------------------------------------------------------------------------

If I make a request to the xml-rpc server with a citycode that does not exist, I get the following dump output:
-------------------
Content-type: text/html

$VAR1 = {
          'faultString' => xml.getCities: no cities found',
          'faultCode' => '1004'
        };
------------------------------------

What could cause the above mentioned error?
use Data::Dumper;
use RPC::XML::Client;
 
#create the client application
my $client = RPC::XML::Client->new(
        'https://user:pwassword@distr-xml.domain.com/xml-rpc', error_handler => sub { die "Transport error: $_[0]" });
print "Content-type: text/html\n\n";
print Dumper $client->simple_request(
        'xml.getCities',
        {rows=>1000,offset=>0,city_ids=>'-3414440'}
);
 
exit;

Open in new window

migarama1Asked:
Who is Participating?
 
Adam314Connect With a Mentor Commented:
The problem appears to be in the Client module.  You might try submitting a bug on CPAN, and see if you get a response.
0
 
mostartCommented:
could you post your /usr/lib/perl5/site_perl/5.8.8/RPC/XML/Client.pm file here (or at least that region around line 365..
0
 
migarama1Author Commented:
.....
    if ($message = $response->headers->header('X-Died'))
    {
        # One of the die's was triggered
        return (ref($self->error_handler) eq 'CODE') ?
            $self->error_handler->($message) : $message;
    }
    unless ($response->is_success)
    {
        $message =  "$me: HTTP server error: " . $response->message;
        return (ref($self->error_handler) eq 'CODE') ?
            $self->error_handler->($message) : $message;
    }

    # Whee. No errors from the callback or the server. Finalize the parsing
    # process.
    eval { $value = $parser->parse_done(); };            ############ THIS IS LINE 365  ##############
    if ($@)
    {
        # One of the die's was triggered
        return (ref($self->error_handler) eq 'CODE') ?
            $self->error_handler->($@) : $@;
    }

    # Check if there is a callback to be invoked in the case of
    # errors or faults
    if (! ref($value))
    {
        $message =  "$me: parse-level error: $value";
        return (ref($self->error_handler) eq 'CODE') ?
            $self->error_handler->($message) : $message;
    }
    elsif ($value->is_fault)
    {
        return (ref($self->fault_handler) eq 'CODE') ?
            $self->fault_handler->($value->value) : $value->value;
    }

    $value->value;
}
.......
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
mostartConnect With a Mentor Commented:
hmm.. its kind of hard to help you like this, since this is so much inside the core.

line 365 points us to the function called $parser->parse_done();
Thats the function which dies.

You could do two things:
1.) try to think about anything that changed before the error first occured. Any perl package updates ? and so on.

2.) Follow the error by look into the function I mentioned above to see why it dies.  
0
 
migarama1Author Commented:
yes, and i have also first to check if the problem occurs on the server- or client side.

As I don't have admin access to the xml-rpc server, I'd have to check it with another xml-rpc client.

What would be the easiest way to check this? is there somewhere a simple windows client to download?
0
 
Adam314Commented:
What is your version of XML::RPC::Client?
perl -MXML::RPC::Client -e 'print "XML::RPC::Client::$VERSION\n"'

Open in new window

0
 
migarama1Author Commented:
I don't get a 'Version'-answer back

This is the output
perl -MRPC::XML::Client -e 'print "XML::RPC::Client::$VERSION\n"'
XML::RPC::Client::






perl -MXML::RPC::Client -e 'print "XML::RPC::Client::$VERSION\n"'

returns

Can't locate XML/RPC/Client.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .).
BEGIN failed--compilation aborted.
0
 
migarama1Author Commented:
/usr/lib/perl5/site_perl/5.8.8/RPC/XML/Client.pm

Version 1.22

###############################################################################
#
# This file copyright (c) 2001 by Randy J. Ray <rjray@blackperl.com>,
# all rights reserved
#
# Copying and distribution are permitted under the terms of the Artistic
# License as distributed with Perl versions 5.002 and later. See
# http://www.opensource.org/licenses/artistic-license.php
#
###############################################################################
#
#   $Id: Client.pm,v 1.22 2004/12/09 08:50:17 rjray Exp $
#
#   Description:    This class implements an RPC::XML client, using LWP to
#                   manage the underlying communication protocols. It relies
#                   on the RPC::XML transaction core for data management.
#
#   Functions:      new
#                   send_request
#                   simple_request
#                   uri
#                   useragent
#                   request
#
#   Libraries:      LWP::UserAgent
#                   HTTP::Request
#                   URI
#                   RPC::XML
#
#   Global Consts:  $VERSION
#
###############################################################################

package RPC::XML::Client;

use 5.005;
use strict;
use vars qw($VERSION);
use subs qw(new simple_request send_request uri useragent request
            fault_handler error_handler combined_handler);
                                                           
0
 
Adam314Commented:
Sorry, I had the module named reversed... it should have been RPC::XML::Client, not XML::RPC::Client.

Anyways, it appears you have version 1.22.  The latest on cpan is version 1.24.  It's possible you've found a bug in the module which has been fixed by a newer version.  Can you upgrade to the latest, and try again?
perl -MRPC::XML::Client -e 'print "RPC::XML::Client::$VERSION\n"'

Open in new window

0
 
migarama1Author Commented:
This has been done yesterday. I upgraded from RPC::XML 0.59  to RPC::XML 0.64 that includes Client.pm 1.24


However, if I execute
perl -MRPC::XML::Client -e 'print "RPC::XML::Client::$VERSION\n"'

I get back "RPC::XML::Client::"          (version number is missing)

no matter if executed as normal user or as root


I first thought the problem could be on the server side. Does above inidicate, that something with my RPC::XML module installation is wrong?

Regards
0
 
migarama1Author Commented:
appendix:

Still getting the following error with the new version:

Problem: no element found at line 1, column 0, byte -1 at /usr/lib/perl5/site_perl/5.8.8/RPC/XML/Client.pm line 363
0
 
migarama1Author Commented:
Do you know a client for windows to test the output of an xml-rpc server? As I haven't changed  anything I suspect the error server-side
0
 
Adam314Commented:
I don't, but google turned up a bunch of results.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.