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