RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

WSDL 1.0 — A modern SOAP toolkit for Ruby

I just released wsdl, a Ruby gem for working with SOAP services. It parses WSDL 1.1 documents, lets you inspect operation contracts, build requests, and invoke operations.

# Create a client and get an operation
client = WSDL::Client.new(‘http://example.com/service?wsdl’)
operation = client.operation(‘GetOrder’)

# Generate starter code from the contract
puts operation.contract.request.body.template(mode: :minimal).to_dsl

# Build and invoke
operation.prepare do
tag(‘GetOrder’) do
tag(‘orderId’, 123)
end
end
response = operation.invoke
response.body # => { “GetOrderResponse” => { “order” => { … } } }

Some highlights:

  • Full WSDL/XSD parsing with import and include resolution
  • Contract introspection — explore request/response structure as flat paths or trees
  • Request templates — generate copy-pastable code from any operation
  • Schema-aware response parsing with automatic type coercion
  • WS-Security — UsernameToken, Timestamps, X.509 Signatures, and response verification

I’m the author of Savon and built this based on years of lessons learned.

GitHub: https://github.com/rubiii/wsdl
RubyGems: https://rubygems.org/gems/wsdl

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in