rjray / rpc-xml Goto Github PK
View Code? Open in Web Editor NEWA Perl implementation of the XML-RPC specification
Home Page: https://metacpan.org/release/RPC-XML
A Perl implementation of the XML-RPC specification
Home Page: https://metacpan.org/release/RPC-XML
RPC::XML - An implementation of XML-RPC Version: 0.82 WHAT IS IT The RPC::XML package is an implementation of XML-RPC. The module provides classes for sample client and server implementations, a server designed as an Apache location-handler, and a suite of data-manipulation classes that are used by them. USING RPC::XML There are not any pre-packaged executables in this distribution (except for a utility tool). Client usage will usually be along the lines of: use RPC::XML::Client; ... my $client = RPC::XML::Client->new( 'http://www.oreillynet.com/meerkat/xml-rpc/server.php' ); my $req = RPC::XML::request->new('meerkat.getChannelsBySubstring', 'perl'); my $res = $client->send_request($req); # This returns an object of the RPC::XML::response class. This double-call # of value() first gets a RPC::XML::* data object from the response, then # the actual data from it: my $value = $res->value->value; Running a simple server is not much more involved: use RPC::XML::Server; ... my $srv = RPC::XML::Server->new( host => 'localhost', port => 9000 ); # You would then use $srv->add_method to add some remotely-callable code ... $srv->accept_loop; # Stays in an accept/connect loop BUILDING/INSTALLING This package is set up to configure and build like a typical Perl extension. To build: perl Makefile.PL make && make test If RPC::XML passes all tests, then: make install You may need super-user access to install. PROBLEMS/BUG REPORTS Please send any reports of problems or bugs to [email protected] or use the GitHub Issues page for this project: https://github.com/rjray/rpc-xml/issues SEE ALSO XML-RPC: http://www.xmlrpc.com/spec The Artistic 2.0: http://www.opensource.org/licenses/artistic-license-2.0.php The LGPL 2.1: http://www.opensource.org/licenses/lgpl-2.1.php CHANGES * Makefile.PL * lib/RPC/XML/Server.pm Bump version numbers. * Makefile.PL * lib/RPC/XML/Server.pm * t/40_server.t * t/40_server_xmllibxml.t * t/41_server_hang.t * t/60_net_server.t * t/util.pl RT #120472: Applied patch from Petr Písař for fixes to IPv6 support. Full detail in the message for this commit in the git repository.
Unable to make:
root@me:~/tmp/rpc-xml# perl Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for RPC::XML
Writing MYMETA.yml and MYMETA.json
root@me:~/tmp/rpc-xml# make && make test
/usr/bin/perl etc/make_method --base=lib/Apache/RPC/status
/usr/bin/perl etc/make_method --base=methods/identity
/usr/bin/perl etc/make_method --base=methods/introspection
/usr/bin/perl etc/make_method --base=methods/listMethods
/usr/bin/perl etc/make_method --base=methods/methodHelp
/usr/bin/perl etc/make_method --base=methods/methodSignature
/usr/bin/perl etc/make_method --base=methods/multicall
/usr/bin/perl etc/make_method --base=methods/status
cp methods/methodHelp.xpl blib/lib/RPC/XML/methodHelp.xpl
cp lib/RPC/XML/Parser/XMLParser.pm blib/lib/RPC/XML/Parser/XMLParser.pm
cp lib/Apache/RPC/status.xpl blib/lib/Apache/RPC/status.xpl
cp lib/RPC/XML/Parser/XMLLibXML.pm blib/lib/RPC/XML/Parser/XMLLibXML.pm
cp lib/Apache/RPC/Server.pm blib/lib/Apache/RPC/Server.pm
cp lib/RPC/XML.pm blib/lib/RPC/XML.pm
cp methods/status.xpl blib/lib/RPC/XML/status.xpl
cp lib/Apache/RPC/Status.pm blib/lib/Apache/RPC/Status.pm
cp lib/RPC/XML/Client.pm blib/lib/RPC/XML/Client.pm
cp methods/identity.xpl blib/lib/RPC/XML/identity.xpl
cp methods/methodSignature.xpl blib/lib/RPC/XML/methodSignature.xpl
cp lib/RPC/XML/Procedure.pm blib/lib/RPC/XML/Procedure.pm
cp lib/RPC/XML/Server.pm blib/lib/RPC/XML/Server.pm
cp lib/RPC/XML/Parser.pm blib/lib/RPC/XML/Parser.pm
cp methods/introspection.xpl blib/lib/RPC/XML/introspection.xpl
cp methods/listMethods.xpl blib/lib/RPC/XML/listMethods.xpl
cp lib/RPC/XML/ParserFactory.pm blib/lib/RPC/XML/ParserFactory.pm
cp methods/multicall.xpl blib/lib/RPC/XML/multicall.xpl
cp etc/make_method blib/script/make_method
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/make_method
Manifying blib/man1/make_method.1p
Manifying blib/man3/Apache::RPC::Server.3pm
Manifying blib/man3/Apache::RPC::Status.3pm
Manifying blib/man3/RPC::XML.3pm
Manifying blib/man3/RPC::XML::Client.3pm
Manifying blib/man3/RPC::XML::Parser.3pm
Manifying blib/man3/RPC::XML::Parser::XMLLibXML.3pm
Manifying blib/man3/RPC::XML::Parser::XMLParser.3pm
Manifying blib/man3/RPC::XML::ParserFactory.3pm
Manifying blib/man3/RPC::XML::Procedure.3pm
Manifying blib/man3/RPC::XML::Server.3pm
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_load.t ..................... ok
t/10_data.t ..................... ok
t/11_base64_fh.t ................ ok
t/12_nil.t ...................... ok
t/13_no_deep_recursion.t ........ ok
t/14_datetime_iso8601.t ......... ok
t/15_serialize.t ................ ok
t/20_xml_parser.t ............... ok
t/21_xml_libxml.t ............... ok
t/25_parser_negative.t .......... ok
t/29_parserfactory.t ............ ok
t/30_procedure.t ................ ok
t/35_namespaces.t ............... ok
t/40_server.t ................... ok
t/40_server_xmllibxml.t ......... ok
t/41_server_hang.t .............. ok
t/50_client.t ................... ok
t/51_client_with_host_header.t .. ok
t/60_net_server.t ............... 2/30
# Failed test 'system.identity matches $srv->product_tokens'
# at t/60_net_server.t line 79.
# got: undef
# expected: 'RPC::XML::Server/1.73'
# Failed test 'system.listMethods returned ARRAY ref'
# at t/60_net_server.t line 88.
# got: ''
# expected: 'ARRAY'
# Failed test 'system.listMethods returned ARRAY ref'
# at t/60_net_server.t line 103.
# got: ''
# expected: 'ARRAY'
# Failed test 'system.listMethods returned ARRAY ref'
# at t/60_net_server.t line 116.
# got: ''
# expected: 'ARRAY'
# Failed test 'system.status returned HASH ref'
# at t/60_net_server.t line 130.
# got: ''
# expected: 'HASH'
# Failed test 'system.methodHelp returned correct string'
# at t/60_net_server.t line 144.
# got: undef
# expected: 'Return the server name and version as a string'
# Failed test 'system.methodHelp returned ARRAY ref'
# at t/60_net_server.t line 150.
# got: ''
# expected: 'ARRAY'
# Failed test ''system.methodHelp (bad arg) response' isa 'RPC::XML::fault''
# at t/60_net_server.t line 165.
# 'system.methodHelp (bad arg) response' isn't a 'RPC::XML::fault'
# Failed test 'system.methodSignature returned ARRAY ref'
# at t/60_net_server.t line 178.
# got: ''
# expected: 'ARRAY'
# Failed test ''system.methodSignature (bad arg) response' isa 'RPC::XML::fault''
# at t/60_net_server.t line 194.
# 'system.methodSignature (bad arg) response' isn't a 'RPC::XML::fault'
# Failed test 'system.multicall returned ARRAY ref'
# at t/60_net_server.t line 251.
# got: ''
# expected: 'ARRAY'
# Looks like you planned 30 tests but ran 29.
# Looks like you failed 11 tests of 29 run.
t/60_net_server.t ............... Dubious, test returned 11 (wstat 2816, 0xb00)
Failed 12/30 subtests
(less 16 skipped subtests: 2 okay)
t/70_compression_detect.t ....... ok
t/90_rt50013_parser_bugs.t ...... ok
t/90_rt54183_sigpipe.t .......... ok
t/90_rt54494_blessed_refs.t ..... ok
t/90_rt58065_allow_nil.t ........ ok
t/90_rt58323_push_parser.t ...... ok
Test Summary Report
-------------------
t/60_net_server.t (Wstat: 2816 Tests: 29 Failed: 11)
Failed tests: 3-4, 7, 9, 11, 14-15, 17, 19, 21, 24
Non-zero exit status: 11
Parse errors: Bad plan. You planned 30 tests but ran 29.
Files=25, Tests=1103, 36 wallclock secs ( 0.15 usr 0.04 sys + 2.80 cusr 0.36 csys = 3.35 CPU)
Result: FAIL
Failed 1/25 test programs. 11/1103 subtests failed.
Makefile:962: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 255
#!/usr/bin/env perl
use 5.014;
use RPC::XML;
use RPC::XML::Client;
my $url = 'https://wordpress.com/xmlrpc.php';
my $client = RPC::XML::Client->new($url);
$client->request->accept_decodable;
print '"Accept-Encoding" set to ' . $client->request->header('Accept-Encoding') . "\n";
my $request = RPC::XML::request->new('wp.getPostTypes');
my $response = $client->send_request($request);
print "$response\n";
"Accept-Encoding" set to gzip, x-gzip, deflate, x-bzip2
not well-formed (invalid token) at line 1, column 0, byte 0:
?PMk1??+???ق??x
^
?
at /usr/share/perl5/RPC/XML/Client.pm line 402.
Everything works correctly in case request is fired w/o callback and response data are processed afterwards.
I've tried just about everything I can think of but I cannot seem to make the server respond on multiple addresses.
For example if I create a server
my $srv = RPC::XML::Server->new(port => 8082, timeout => 120, url => '/RPC2');
Assume that we are using a local address 192.168.1.10
And try to access the server at http://127.0.0.1:8082/RPC2 it works fine BUT when I try
http://localhost:8082/RPC2
or
http://192.168.1.10:8082/RPC2
It does not respond. Now if I try http://localhost:8082/RPC2 first then then other two addresses don't work. It seems that whatever address I try first becomes the only address that I can hit the server on until I restart it.
So it seems that its binded to all addresses but it can only respond on one and its always the first address that is used by a client connection.
Hello,
I'm maintaining an XML::RPC server application running on RPC::XML version 0.73.
I try to update to 0.82 but my function names are no longer accepted by RPC::XML.
The error message is: RPC::XML::request::new: Invalid method name specified
My function names have all a prefix containing a "-" sign and the dash causes the error.
$cli->send_request('de.bw-fe.aht.login',$mn,$user)
Please add the dash again to the allowed characters in function names.
I was trying to install the CPAN package as part of https://aur.archlinux.org/packages/perl-rpc-xml/ (which I need to compiler docker-git ultimately), but I ran into this error:
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_load.t ..................... ok
t/10_data.t ..................... ok
t/11_base64_fh.t ................ ok
t/12_nil.t ...................... ok
t/13_no_deep_recursion.t ........ ok
t/14_datetime_iso8601.t ......... skipped: DateTime::Format::ISO8601 not available
t/15_serialize.t ................ ok
t/20_xml_parser.t ............... ok
t/21_xml_libxml.t ............... ok
t/25_parser_negative.t .......... ok
t/29_parserfactory.t ............ ok
t/30_procedure.t ................ ok
t/35_namespaces.t ............... ok
t/40_server.t ................... 16/91
# Failed test 'RPC::XML::Server::url method (set)'
# at t/40_server.t line 188.
# 'http://[::1]:41259/'
# doesn't match '(?^:http://(127[.]0[.]0[.]1|localhost|localhost[.]localdomain):41259)'
t/40_server.t ................... 35/91 Use of uninitialized value in subroutine entry at t/40_server.t line 276.
t/40_server.t ................... 41/91 Not an ARRAY reference at t/40_server.t line 333.
# Looks like your test exited with 255 just after 43.
I am not absolutely certain this is the correct repository to report this to, because perl package tests seem to fail often due to upstream changes from what little experience I have with CPAN.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.