jorgevaldivia / salesforce_bulk

Simple Salesforce Bulk API interface
53 stars 85 forks source link

Appears to have stopped working on SF sandbox due to URL change #15

Open seanpd opened 11 years ago

seanpd commented 11 years ago

Sometime in the past week it no longer accesses the SF sandbox. I think SF changed the URL so the #parse_instance regex no longer recognizes it.

This monkeypatch makes it work again:

module SalesforceBulk
 class Connection
   def parse_instance()
     m = /https:\/\/([a-z]{2,2}[0-9]{1,2})(-api|\.)/.match(@server_url)
     return '' unless m
     @instance = m[1]
   end
 end
end

The @server_url used to look something like https://cs14-api.salesforce.com/services/Soap/u/24.0/x but now it looks like https://cs14.salesforce.com/services/Soap/u/24.0/x The orig code wants the '-api' there.