Skip to content

sdball/savonforce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

savonforce

DESCRIPTION:

SavonForce is an extremely simple wrapper using Savon to connect to the salesforce SOAP API.

FEATURES/PROBLEMS:

As it’s using Savon, SavonForce needs to access the salesforce WSDL file over HTTP. Salesforce doesn’t have a publicly available link to the WSDL file since it’s generated per setup. You’ll need to generate your WSDL file (enterprise or partner) and place it somewhere you can access. Somewhere secure if you care about your data schema’s privacy. This requirement is fixed in Savon 0.8, which is yet to be released.

I solve this by placing my WSDL file on my machine, then serving it with the simple python: python -m SimpleHTTPServer ${1:-8080};. That line serves the current directory over http on port 8080.

SavonForce doesn’t know, or care, anything about the salesforce API up front. It’s purely a wrapper to the functions and data defined by the WSDL file.

SavonForce’s interface intentionally mirrors that of rforce.

This library is purely a proof of concept and has not (and should not) be used in a production environment.

SYNOPSIS:


require ‘mysalesforce’

  1. localhost:8080 is a directory served with:
  2. python -m SimpleHTTPServer ${1:-8080};
    binding = SavonForce::Binding.new “http://localhost:8080/partner-wsdl.jsp.xml”
    userID = ‘salesforce_user’
    password = ‘password’
    securityToken = ‘generated by salesforce’
    binding.login userID, (password + securityToken)
  1. a simple search
    result = binding.search(
    { :searchString => “FIND {Account Name} IN name FIELDS” \
    RETURNING account(id, name, phone) LIMIT 1” })
    result_data = result[:search_records][:record]
  1. creating an account
    response = binding.create :sObject => { :type => ‘Account’,
    :name => ‘SavonForce Account’ }
  2. response should be something like:
  3. {:id=>"(salesforce generated ID)", :success=>true}

REQUIREMENTS:

  • Savon
  • A SalesForce Enterprise or Developer account

INSTALL:

  • Place savonforce.rb in your load path.

About

A Ruby interface to the SalesForce SOAP API using the Savon library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages