Skip to content

Instantly share code, notes, and snippets.

@rubiii
Created May 23, 2010 18:59
Show Gist options
  • Save rubiii/411165 to your computer and use it in GitHub Desktop.
Save rubiii/411165 to your computer and use it in GitHub Desktop.
require "savon"
client = Savon::Client.new "http://example.com"
client.login! { |soap| soap.body = { :username => 'un', :password => 'pw' } }
# Expected debug output:
#
# SOAP request: http://example.com
# SOAPAction: login, Content-Type: text/xml;charset=UTF-8
# <?xml version="1.0" encoding="UTF-8"?>
# <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
# <env:Body>
# <wsdl:login>
# <username>un</username>
# <password>pw</password>
# </wsdl:login>
# </env:Body>
# </env:Envelope>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment