Savon vs. Handsoap: Errors

This documentation is deprecated, please have a look at savonrb.com!

Both client libraries provide the same default behavior for error handling; they raise distinct exceptions for SOAP and HTTP errors:

  • Handsoap::HttpError / Handsoap::Fault
  • Savon::HTTPError / Savon::SOAPFault

And both clients offer a way to override that behavior. Savon lets you surpress errors globally and provides a simple error handling interface on the response object:

Savon::Response.raise_errors = false
[...]
p response.soap_fault
p response.http_error

The same can be achieved in Handsoap by overwriting error hooks in the service implementation:

def on_fault(fault)
  p fault
end

def on_http_error(response)
  p response
end

Published by

phoet

I am a professional Software Developer from Hamburg, Germany.

One thought on “Savon vs. Handsoap: Errors”

Comments are closed.