-
-
Save slpsys/954483 to your computer and use it in GitHub Desktop.
Soap service test
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'savon' | |
require 'pp' | |
url = "http://www.xignite.com/xFinancials.asmx?WSDL" | |
client = Savon::Client.new(url) | |
response = client.request :get_other_ratios do | |
soap.env_namespace = "" | |
soap.element_form_default = false | |
soap.namespaces["xmlns:xignite"] = "http://www.xignite.com/services/" | |
soap.input = "xignite:GetOtherRatios" | |
soap.header = { | |
"xignite:Header" => { | |
"xignite:Username" => "you@yourcompany.com" | |
} | |
} | |
soap.body = { | |
"xignite:Identifier" => "FCX", | |
"xignite:IdentifierType" => 'Symbol', | |
"xignite:ReportType" => 'Latest', | |
"xignite:AsOfDate" => "#{Time.now.month}/#{Time.now.day}/#{Time.now.year}" | |
} | |
end | |
pp response.to_hash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! This worked perfectly.