Created
June 29, 2012 23:57
-
-
Save jcuffe/3021508 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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