undees / rforce (http://rforce.rubyforge.org)

A simple, usable binding to the SalesForce API.

Clone this repository (size: 109.4 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/undees/rforce/

Changed (Δ62 bytes):

raw changeset »

lib/rforce/binding.rb (6 lines added, 3 lines removed)

Up to file-list lib/rforce/binding.rb:

@@ -84,10 +84,13 @@ module RForce
84
84
    # a hash or (if order is important) an array of alternating
85
85
    # keys and values.
86
86
    def call_remote(method, args)
87
88
      urn, soap_url = block_given? ? yield : ["urn:partner.soap.sforce.com", @url.path]
89
87
90
      # Create XML text from the arguments.
88
91
      expanded = ''
89
92
      @builder = Builder::XmlMarkup.new(:target => expanded)
90
      expand(@builder, {method => args}, 'urn:partner.soap.sforce.com')
93
      expand(@builder, {method => args}, urn)
91
94
92
95
      extra_headers = ""
93
96
      extra_headers << (AssignmentRuleHeaderUsingRuleId % assignment_rule_id) if assignment_rule_id
@@ -128,7 +131,7 @@ module RForce
128
131
      end
129
132
130
133
      # Send the request to the server and read the response.
131
      response = @server.post2(@url.path, request.lstrip, headers)
134
      response = @server.post2(soap_url, request.lstrip, headers)
132
135
133
136
      # decode if we have encoding
134
137
      content = decode(response)
@@ -142,7 +145,7 @@ module RForce
142
145
        request = encode(request)
143
146
144
147
        # Send the request to the server and read the response.
145
        response = @server.post2(@url.path, request.lstrip, headers)
148
        response = @server.post2(soap_url, request.lstrip, headers)
146
149
147
150
        content = decode(response)
148
151
      end