I starting to work with Ruby and Soap and had some questions:
How do I generate a WSDL file for the service I created? Will it be compatible with an .NET client ?
begin class MyServer < SOAP::RPC::StandaloneServer # Handler methods def add(a, b) return a + b end def div(a, b) return a / b end # Expose our services def initialize(*args) add_method(self, 'add', 'a', 'b') add_method(self, 'div', 'a', 'b') end end server = MyServer.new('MyServer', 'urn:ruby:calculation', 'localhost', 8080) trap('INT'){ server.shutdown } server.start rescue => err puts err.message end
ActionWebService (previously in Rails core, now a gem) has tools to generate WSDL files. You can use the tools even if you’re not running your service within Rails.
http://www.datanoise.com/articles/2008/7/2/actionwebservice-is-back
As for whether it will work with a .NET client, the answer is maybe. Many .NET clients seem to expect Microsoft’s "extended" SOAP info, which .NET webservices provide by default. If the client is also able to consume a service without that extra stuff, then sure.
UPDATE #1
The above link no longer appears to work. There are however forks of ActionWebService that have popped up over on github. You can see a pretty good list of them here. Here are a couple of links to some key versions: