So, I made my first webservice using xml-rpc. The server providing the service was created using Ruby, and Ruby’s XMLRPC classes’s builtin HTTP server WEBrick to host the service. Here’s the Ruby code:
require ‘xmlrpc/server’
s = XMLRPC::Server.new(8081)
s.add_handler(“sample.test”) do
{“hello” => “goodbye”}
end
s.serve
I then created a Java class which requested the services, and read the hash table returned by the service. I’m still thinking about how, or if XMLRPC will be the best way to go to accomplish RPCs. In my head I can picture a simple XMLRPC wrapper to the class I wish to access, however, I am undecided about security and running the service with the correct permissions.
Related posts: