I'm using http://demo.sugarcrm.com for testing. I'm using SOAP and Ruby to get data from SugarCRM, however I'm getting intermittent error "The session ID is invalid". Here is a snippet of a ruby code that logs in, gets list of all available modules and logs out 10 times. It fails about 50% of the time with "The session ID is invalid" error. I don't see anything wrong with my code so I was wondering if anyone has seen similar problem with SOAP on http://demo.sugarcrm.com. Please help! Thanks!
Code:require 'soap/wsdlDriver' require 'digest/md5' wsdl, user, pwd = "http://demo.sugarcrm.com/sugarcrm/soap.php?wsdl", "will", "will" ua = {"user_name" => user,"password" => Digest::MD5.hexdigest(pwd)} 10.times do driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver session = driver.login(ua,nil) if session.error.number == '0' res = driver.get_available_modules(session.id) puts res.error.number == '0' ? 'OK' : 'Error: ' + res.error.description driver.logout(session.id) else puts 'Error: ' + session.error.description end end


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks