How to create WSDL using Ruby?

I started working with Ruby and Soap and had some questions:

How to create a WSDL file for the created service? Will it be compatible with the .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 
+4
source share
1 answer

ActionWebService (formerly in the Rails core, now a gem) has tools for creating WSDL files. You can use the tools even if you are not using your service in Rails.

http://www.datanoise.com/articles/2008/7/2/actionwebservice-is-back

As for whether it will work with the .NET client, the answer may be. Many .NET clients seem to expect Microsoft to have the "extended" SOAP information that .NET web services provide by default. If the client can also consume the service without this additional material, then it is mandatory.

UPDATE # 1

The above link no longer works. However, there are ActionWebService forks that appeared on github. You can see a pretty good list of them here . Here are some links to some key versions:

+4
source

Source: https://habr.com/ru/post/1276961/


All Articles