[Openstreetmap] gpx track upload

Paul Makepeace openstreetmap at paulm.com
Thu Jul 28 10:46:07 BST 2005


Je 2005-07-28 09:18:14 +0100, Richard Fairhurst skribis:
> I had a bunch of similar trouble with XMLRPC::Lite at the weekend, but 
> eventually got it working... mostly.

I would simply use RPC::XML. There are a few gotchas if you get deep
into it (I've submitted patches for a few), and a moderate RTFM to begin
with, but it works well and reliably IME:

  my $client = RPC::XML::Client->new($xmlrpc_uri);
  $client->compress_requests(1);
  my @data = (
        LOCATE_X => 529788,
        LOCATE_Y => 181557,
        LOCATE_RANGE => 20,
  );
  my $req = RPC::XML::request->new('server.method' => @data);
  #print $req->as_string, "\n";
  my $resp = $client->send_request($req);
  my ($code, $result) = @{$resp->value};
  if ($code == 0) {
    print "success: ", Dumper($result), "\n";
  } else {
    print "failed: $code\n";
  }

One of the gotchas was the server I was contacting wanted everything as
a string rather than say integer which RPC::XML would otherwise deduce.
This meant using writing wrappers that used stuff like,
   sub str { RPC::XML::string->new(shift) }

Happy to help out if this isn't enough to get going -
P

-- 
Paul Makepeace .............................. http://paulm.com/inchoate/

"What is I? Use your imagination ;)."
   -- http://paulm.com/toys/surrealism/




More information about the talk mailing list