Skip to content

Instantly share code, notes, and snippets.

@slpsys
Forked from stw/gist:953289
Created May 3, 2011 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save slpsys/954483 to your computer and use it in GitHub Desktop.
Save slpsys/954483 to your computer and use it in GitHub Desktop.
Soap service test
#!/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
@stw
Copy link

stw commented May 5, 2011

Thanks! This worked perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment