Solved

xml-rpc troubleshooting

Posted on 2009-05-12
13
830 Views
Last Modified: 2012-05-06
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

0
Comment
Question by:migarama1
  • 7
  • 4
  • 2
13 Comments
 
LVL 8

Expert Comment

by:mostart
Comment Utility
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
 

Author Comment

by:migarama1
Comment Utility
.....
    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
 
LVL 8

Assisted Solution

by:mostart
mostart earned 50 total points
Comment Utility
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
 

Author Comment

by:migarama1
Comment Utility
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
 
LVL 39

Expert Comment

by:Adam314
Comment Utility
What is your version of XML::RPC::Client?
perl -MXML::RPC::Client -e 'print "XML::RPC::Client::$VERSION\n"'

Open in new window

0
 

Author Comment

by:migarama1
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:migarama1
Comment Utility
/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
 
LVL 39

Expert Comment

by:Adam314
Comment Utility
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
 

Author Comment

by:migarama1
Comment Utility
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
 

Author Comment

by:migarama1
Comment Utility
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
 
LVL 39

Accepted Solution

by:
Adam314 earned 200 total points
Comment Utility
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
 

Author Comment

by:migarama1
Comment Utility
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
 
LVL 39

Expert Comment

by:Adam314
Comment Utility
I don't, but google turned up a bunch of results.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now