Guest User

Untitled

a guest
May 16th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. require 'rubygems'
  2. gem 'soap4r'
  3. require 'soap/soap'
  4. require 'defaultDriver'
  5. require 'client_auth_header_handler'
  6.  
  7. d = Soap.new
  8. d.wiredump_dev = STDOUT
  9.  
  10. h = ClientAuthHeaderHandler.new # Create a new handler
  11.  
  12. l = d.login(:username => your_username, :password => your_password + security_token)
  13.  
  14. d.endpoint_url = l.result.serverUrl # Change the endpoint to what login tells us it should be
  15. h.sessionid = l.result.sessionId # Tell the header handler what the session id is
  16. d.headerhandler << h # Add the header handler to the Array of headerhandlers
  17.  
  18. d.getUserInfo("") # Make an API call; the empty String appears to be necessary
Add Comment
Please, Sign In to add comment