1 require 'rubygems' 2 gem 'soap4r' 3 require 'soap/soap' 4 require 'defaultDriver' 5 require 'client_auth_header_handler' 6 require 'soap/wsdlDriver' 7 8 9 d = Soap.new 10 d.wiredump_dev = STDOUT 11 12 h = ClientAuthHeaderHandler.new # Create a new handler 13 14 l = d.login(:username => "USERNAME", :password => "PASSWORD" + "SECURITY_TOKEN") 15 16 d.endpoint_url = l.result.serverUrl # Change the endpoint to what login tells us it should be 17 h.sessionid = l.result.sessionId # Tell the header handler what the session id is 18 d.headerhandler << h # Add the header handler to the Array of headerhandlers 19 20 d.getUserInfo("") 21 d.query(:queryString=> "select id,name from account")