From f850f0fbbf4c98d85e8febd87d23fcd3e963985f Mon Sep 17 00:00:00 2001 From: Will Bradley Date: Tue, 6 Nov 2012 01:33:14 -0700 Subject: [PATCH] Initial commit --- README.txt | 11 +++++++++++ edex.rb | 23 +++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 README.txt create mode 100644 edex.rb diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..1b975ec --- /dev/null +++ b/README.txt @@ -0,0 +1,11 @@ +eDex API Example (For Infor / AMSI / eSite) +This code is released to the public domain and is +provided by Will Bradley, unaffiliated with Infor or AMSI +and with no warranty whatsoever. + +To use, you'll need the savon and nokogiri gems installed, +and you'll need to get the appropriate YOUR_X_HERE variables +from your account representative and put them in edex.rb. + +You can then run 'ruby edex.rb' from the command line (assuming +you have Ruby installed.) diff --git a/edex.rb b/edex.rb new file mode 100644 index 0000000..a1828dd --- /dev/null +++ b/edex.rb @@ -0,0 +1,23 @@ +# eDex API Example (For Infor / AMSI / eSite) +# This code is released to the public domain and is +# provided by Will Bradley, unaffiliated with Infor or AMSI +# and with no warranty whatsoever. + +# See README for usage info. + +class UnitsController < ApplicationController +require 'savon' +require 'nokogiri' + + # GET /units + def index + client = Savon::Client.new "http://amsi.saas.infor.com/AMSIWEBG003/edexweb/esite/leasing.asmx?wsdl" + response = client.get_property_units do |soap| + soap.xml = ' YOUR_EDEX_USERID_HERE YOUR_EDEX_PASSWORD_HERE YOUR_COMPANY_NAME_HERE|YOUR_PORTAL_NAME_HERE YOUR_PROPERTY_ID_HERE0]]> ' + end + property_data = response.to_hash[:get_property_units_response][:get_property_units_result] + doc = Nokogiri::XML(property_data) + @view = doc.css('Unit')[0]['UnitId'] + end + +end \ No newline at end of file