function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
undeesundees 

New Ruby binding for SalesForce

Hi, all.

I've slapped together a lightweight little Ruby binding for the SalesForce API. The project was inspired by the older XMLRPC-based wrapper and the generic soap4r library (though it doesn't actually use either one).

The .rb file is available at http://rubyforge.org/projects/rforce.
Documentation (such as it is) is at http://rforce.rubyforge.org.

Enjoy!
adamgadamg
Thanks!!!
JasonRogersJasonRogers
This doesn't seem to support zero arg. method calls (eg. describeGlobal on the Enterprise WSDL). Any idea how to support this?
JasonRogersJasonRogers
I got it working. I changed the 'call_remote' method to check for an empty or nil 'args' argument:

if args.nil? || args.empty?
@builder.tag!(method, {:xmlns => 'urn:enterprise.soap.sforce.com'})
else
expand({method => args}, 'urn:enterprise.soap.sforce.com')
end

Now I call binding.describeGlobal({}). Perhaps the checking should be done in 'method_missing(method, *args)' so that it tries a call without arguments if none are supplied and then raises an exception if it was not successful.

Thanks for a simple library!!
undeesundees
This is great, Jason. Mind if I include this in the official project?

--undees