Last active
June 2, 2017 17:17
-
-
Save JosiahSiegel/13fe3bc8ad9ca9e83b44 to your computer and use it in GitHub Desktop.
#Rails Use Savon to make request and retrieve XML result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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