savonrb / savon

Heavy metal SOAP client
https://www.savonrb.com
MIT License
2.07k stars 618 forks source link
ruby soap soap-client

Savon

Heavy metal SOAP client

Documentation | Support | Mailing list | Twitter

Ruby Gem Version Code Climate Coverage Status

If you're reading this on GitHub, note that this README is for the main branch and that features/changes described here might not correspond to your version. You can find the documentation for your release at rubydoc.info.

Installation

Savon is available through Rubygems and can be installed via:

$ gem install savon

or add it to your Gemfile like this:

gem 'savon', '~> 3.0.0'

Usage example

require 'savon'

# create a client for the service
client = Savon.client(wsdl: 'http://service.example.com?wsdl')

# or: create a client with a wsdl provided as a string
client = Savon.client do |config|
  wsdl_content = File.read("/path/to/wsdl")
  config.wsdl wsdl_content
end

client.operations
# => [:find_user, :list_users]

# call the 'findUser' operation
response = client.call(:find_user, message: { id: 42 })

response.body
# => { find_user_response: { id: 42, name: 'Hoff' } }

For more examples, you should check out the integration tests.

Upgrading from v2.x to v3.x

See UPGRADING.md for more information.

Ruby version support

Every savon release is tested with contemporary supported versions of ruby. Historical compatibility information:

If you are running MRI 1.8.7, try a 2.6.x release.

Most changes are not backported to older versions of savon, or unsupported ruby versions.

Running tests

$ bundle install
$ bundle exec rspec

FAQ

Documentation

Please be sure to read the documentation.