Savon

Heavy metal SOAP client

GitHub RubyGems

Ruby SOAP Client

Savon is a SOAP client for Ruby. It reads a WSDL document, discovers available operations, and handles the conversion between Ruby and XML in both directions. You write Ruby hashes and get Ruby hashes back.

Savon 2.x is the current stable version and requires Ruby 3.0 or later.

Installation

Add to your Gemfile and run bundle install:

gem 'savon', '~> 2.17'

What’s in the docs

SOAP & WSDL

New to SOAP? Start here. Explains what SOAP is, what a WSDL document contains, how Savon reads it, and what to do when you don't have one.

Client

How to create a client from a WSDL URL or file, use the block interface, and list available operations.

Global options

Options passed to Savon.client that apply to all requests. They cover authentication, logging, SSL, timeouts, response parsing, request building, and transport.

Authentication

Savon supports HTTP basic, digest, and NTLM authentication, plus WS-Security (WSSE) with username/password, digest, and timestamp.

Reading responses

The response body comes back as a nested Hash with snake_case symbol keys. You can also access raw XML, query with XPath, and inspect the HTTP response directly.

Error handling

Savon raises on SOAP faults and HTTP errors by default. This page covers the three exception classes, how to read fault details, and how to handle errors manually.

Debugging

How to enable logging, inspect raw envelopes, filter sensitive values from logs, and diagnose common failures.

Testing

Mocking SOAP responses in tests without hitting a real service, using Savon::SpecHelper.

Examples

Focused, copy-pasteable snippets for common patterns: key conversion, nested messages, arrays, response navigation, error handling, and more.