salesforcebulk 4.0.0 → 4.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f820b68636330723af5423eac1fd9c0bbbc09cb22fe14651bf82f9b9a76108bf
4
- data.tar.gz: af753d04858e10b980c5c140ab2e0bd251f33edd4e9382f96c0112d40a16f0e4
3
+ metadata.gz: 42ac9c846c52bca60cea6a59ef20772e9f73752f4a6033767b7686ab5db36c79
4
+ data.tar.gz: 730c25ca9264445f4493740f294c09427e56f58236f2b12ea044c8fdc855b26f
5
5
  SHA512:
6
- metadata.gz: 880925281c6aded2a647d9ad59eed9d9f5d2459c8093e9616f8569ee675b7562e8504663e64421e7d4d8ba3e7c73db0be534de75fe41af082b15cfcd5f08fa3e
7
- data.tar.gz: 7987781dfd889b6b27f0ae32bf13e49f83a3e1f8c1872c42ca47bb0c33605b13aeeb7d71002b8d02f9072a44d8f76b665b29254ffc8ae022832d4fa48a85aa88
6
+ metadata.gz: 7aa5f86d57dfeb8eb463e0f7a444d5f757622ba5e26a73013c3e58b3de20c0464de541c3edef878b72a8d081ec9acac7cf99f0353f03d58942b4b583e17fc485
7
+ data.tar.gz: ae2bc3c0bd319fd7f3dbde38f34233e4aadfb06af0dfba06bd53be88be477401259d22b3690c956da23c6c74940c72238f85fbf5f25398e067ee4bfef735716f
@@ -47,7 +47,7 @@ module SalesforceBulk
47
47
  xml += "<env:Body>"
48
48
  xml += '<n1:login xmlns:n1="urn:partner.soap.sforce.com">'
49
49
  xml += "<n1:username>#{username}</n1:username>"
50
- xml += "<n1:password>#{password}</n1:password>"
50
+ xml += "<n1:password>#{password.encode(xml: :text)}</n1:password>"
51
51
  xml += "</n1:login>"
52
52
  xml += "</env:Body>"
53
53
  xml += "</env:Envelope>\n"
@@ -5,25 +5,28 @@ module SalesforceBulk
5
5
  attr_accessor :response
6
6
  # The status code from the server response body.
7
7
  attr_accessor :error_code
8
-
8
+
9
9
  def initialize(response)
10
10
  self.response = response
11
-
12
- data = XmlSimple.xml_in(response.body, 'ForceArray' => false)
13
-
14
- if data
15
- # seems responses for CSV requests use a different XML return format
16
- # (use invalid_error.xml for reference)
17
- if !data['exceptionMessage'].nil?
18
- message = data['exceptionMessage']
19
- else
20
- # SOAP error response
21
- message = data['Body']['Fault']['faultstring']
11
+ self.error_code = response.code
12
+
13
+ if (300..308).cover?(error_code.to_i)
14
+ message = "Moved to #{response.header['location']}"
15
+ else
16
+ data = XmlSimple.xml_in(response.body, 'ForceArray' => false)
17
+
18
+ if data
19
+ # seems responses for CSV requests use a different XML return format
20
+ # (use invalid_error.xml for reference)
21
+ if !data['exceptionMessage'].nil?
22
+ message = data['exceptionMessage']
23
+ else
24
+ # SOAP error response
25
+ message = data['Body']['Fault']['faultstring']
26
+ end
22
27
  end
23
-
24
- self.error_code = response.code
25
28
  end
26
-
29
+
27
30
  super(message)
28
31
  end
29
32
  end
@@ -1,3 +1,3 @@
1
1
  module SalesforceBulk
2
- VERSION = "4.0.0"
2
+ VERSION = "4.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesforcebulk
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Julio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-05 00:00:00.000000000 Z
11
+ date: 2022-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  requirements: []
133
- rubygems_version: 3.1.4
133
+ rubygems_version: 3.3.6
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Full capability support for the Salesforce Bulk API.