Skip to content

Instantly share code, notes, and snippets.

@jcuffe
Created June 29, 2012 23:57
Show Gist options
  • Save jcuffe/3021508 to your computer and use it in GitHub Desktop.
Save jcuffe/3021508 to your computer and use it in GitHub Desktop.
report = 'MonthlyTop3DenialCodes'
request_date = Date.today
soap_client = LolSoap::Client.new(ACS_SOAP[:definitions][:report_data_service])
soap_request = soap_client.request('GetMonthlyReportData')
soap_request.body do |b|
b.ReportName report
b.ReportYear request_date.year
b.ReportMonth request_date.strftime("%m")
end
request_http = Patron::Session.new
request_http.timeout = 10
request_uri = URI.parse(soap_request.url)
request_http.base_url = request_uri.host
raw_response = request_http.post(request_uri.path, soap_request.content, soap_request.headers).body
response = soap_client.response(soap_request, raw_response)
parsed_response = JSON.parse(response.body_hash['GetMonthlyReportDataResult'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment