I've been using XSLT, DOM, and SAX for about a year now to do device
independent web sites. I want to start doing some web services.
I have "Programming Web Services with Perl" and it all makes sense so
far, but I have a few questions.
I figured I'd start with RPC as thats where the book starts.
Ive tested and used Apache::XMLRPC::Lite and it works great.
I wanted to try Apache::RPC::Server because of the built in
documentation system and status gui.
I have two questions:
<question id="1">
I put the following right before the part about: #Section 2 main server:
<Perl>
use Apache::RPC::Server ();
$main::ecgRpc = Apache::RPC::Server->new(
path => '/rpc',
auto_methods => 1,
auto_updates => 1
);
$Location{'/rpc'} =
{
SetHandler => 'perl-script',
PerlHandler => '$main::ecgRpc',
};
$Location{'/rpc-status'} =
{
SetHandler => 'perl-script',
PerlHandler => 'Apache::RPC::Status',
};
</Perl>
The server IS running:
[trwww@devel_rh trwww]$ perl
require RPC::XML;
require RPC::XML::Client;
$cli = RPC::XML::Client->new('http://localhost/rpc');
$resp = $cli->send_request('system.listMethods');
print( ((ref $resp) ? join(', ', @{$resp->value}) : "Error: $resp"), "\n");
Ctrl-D
system.identity, system.introspection, system.listMethods,
system.methodHelp, system.methodSignature, system.multicall, system.status
but when I point my browser at http://localhost/rpc-status, it says that
there are 0 servers running?
</question>
<question id="2">
I also have SOAP::Lite installed, which provided a simple program called
RPCXMLsh.pl. I thought I would be able to use it to query my
Apache::RPC::Server server because RPC is RPC no matter how it is
implemented, but I got:
[trwww@devel_rh rpc]$ perl /usr/bin/XMLRPCsh.pl http://localhost/rpc
Usage: method[(parameters)]
> system.listMethods
--- SYNTAX ERROR ---
Unexpected Content-Type '' returned
> Ctrl-D
I took a look at Apache/RPC/Server.pm and I think I understand why this
dosent work. The code for the handler checks that an incoming http
header called content-type is set to 'text/xml'
But I couldnt find methods in XMLRPC::Lite or SOAP::Lite to add/modify
httpd headers?
</question>
Thank you,
Todd W.