#from http://www.devx.com/enterprise/Article/28101/1954?pf=true require 'soap/rpc/standaloneserver' # define a class that has three methods to call remotely: class DemoClass def upper_case(a_string) a_string.upcase end def lower_case(a_string) a_string.downcase end def times_string(a_string, a_number) a_string * a_number end end # create a SOAP enabled server for the methods in DemoClass: class MyServer < SOAP::RPC::StandaloneServer def on_init demo = DemoClass.new add_method(demo, "upper_case", "a_string") add_method(demo, "lower_case", "a_string") add_method(demo, "times_string", "a_string", "a_number") end end server = MyServer.new("Demo", "http://markwatson.com/Demo", "0.0.0.0", 9090) trap('INT') { server.shutdown } server.start