Depending on Savon github.com/rubiii/savon Doku of Savon rubiii.github.com/savon/
THIS IS CURRENTLY UNDER DEVELOPMENT and should by ready within next week
Your Webservers IP has to be registered at HRS. Send a mail to [email protected]
To initialize a new Service hrs = HRS::Service.new Update hrs_service.yml with your HRS-DATA copy config/hrs_service.yml to your config dir and modify it
This will start a new Service with your current Rails Environment (“production” || “development/test”) on the different HRS Servers TestServer = “iut-service.hrs.com:8080” ProductionServer = “p-service.hrs.com:8080”
you can overwrite this by calling: hrs = HRS::Service.new(args)
with args folloing Options: HRS::Service.new({:env => “production”, :version => “015”}) :env => which Server to use (production or test) :version => which version of WebService you want to use (Default “015” - 01.03.2011 ) :language => overwrite default Iso3Language (default => “ENG”) … Methods:
To check if a connection to HRS ist established and ready to use: hrs.ping => Savon::SOAP::Response Get a list of locations like: hrs.search_locations(“Berlin”) => {:location_type=>“city”, :location_name=>“Berlin”, :location_language=>{:iso3_language=>“eng”, :variant_iso3_country=>nil}, :iso3_country=>“deu”, :location_id=>“55133”, :poi_id=>nil, :geo_position=>{:latitude=>“52.51628”, :longitude=>“13.3776”}} hrs.search_locations(“Hauptstrasse 12, Berlin”) => Location search by Address
Search for all Hotels nearby a location (Access may be restricted): hrs.search_hotels(location_id, perimeter=1000, maxResults=0, minAverageRating=0, minCategory=0) Get available Hotels for a location and a time span with from_date/to_date format of “2011-12-30”: hrs.available_hotels(location_id, from_date, to_date, perimeter=1000, maxResults=0, minCategory=0, roomType=“single”, adultCount=1, orderKey=“price”, orderDirection=“ascending” )
Get detailed hotel information hotel_availabilty(hotel_key, from_date, to_date, roomType, adultCount)