# 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