• ykatz
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I'm trying to figure out how to use Salesforce to authenticate against. I'm using the API to make a login call against the SF API, but it requires the token, not just the username and password.

In order to get connected in the first place, I have turned off SSL verification; perhaps this is the issue. Here's the experimental code I'm using (Ruby):

---

require 'soap/wsdlDriver'
wsdl = "file:///Users/wycats/Documents/salesforce.wsdl" # our wsdl generated by SF
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
driver.options['protocol.http.ssl_config.verify_mode'] = OpenSSL::SSL::VERIFY_NONE
driver.login(:username => "", :password => "")

# Result
# SOAP::FaultError: LOGIN_MUST_USE_SECURITY_TOKEN: Invalid username, password, security token; or user
# locked out. Are you at a new location? When accessing Salesforce--either via a desktop client or the
# API--from outside of your company’s trusted networks, you must add a security token to your password to
# log in. To receive a new security token, log in to Salesforce at http://www.salesforce.com and click
# Setup | My Personal Information | Reset Security Token.

---

Ideas?
  • March 12, 2008
  • Like
  • 0
I'm building an adapter for Ruby's DataMapper for Salesforce. I've been able to use the WSDL with SOAP to make #query calls to Salesforce. However, I can't figure out how to use Ruby code to update an object (because Ruby's SOAP connector is not quite as snap-in as Java or C#'s connector).

The code I've been using to set up the connection is at: http://pastie.caboo.se/private/wcqjqv1icvshqpucsxupq

It's a little bit frustrating that Salesforce hung its Ruby hat on ActiveSalesforce, which is more a Rails/ActiveRecord solution than a general-purpose Ruby solution. Ideally, Salesforce would have built a low-level library to connect to its webservices, and then built ActiveSalesforce on top of it (the code for ASF is a mess, and includes a partial solution that someone was building prior to the release of ASF).

Anyhow, I'd appreciate any help someone could provide about making reliable #update calls back to the server for objects returned as a result of a #query call.
  • April 10, 2008
  • Like
  • 0