Skip to content

Instantly share code, notes, and snippets.

@JosiahSiegel
Last active June 2, 2017 17:17
Show Gist options
  • Save JosiahSiegel/13fe3bc8ad9ca9e83b44 to your computer and use it in GitHub Desktop.
Save JosiahSiegel/13fe3bc8ad9ca9e83b44 to your computer and use it in GitHub Desktop.
#Rails Use Savon to make request and retrieve XML result
private
def self.get_response
c = Savon.client(wsdl: 'local_wsdl.wsdl', ssl_verify_mode: :none)
r = c.call(:login, message: { "String_1" => "xxxx", "String_2" => Rails.application.secrets.SECRET }, response_parser: :rexml)
result_xml = Nokogiri::XML(r.body[:response][:result])
response = Hash.from_xml(result_xml.to_s)
response["Response"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment