savon-xaop 0.7.2.5 → 0.7.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/savon.rb CHANGED
@@ -10,7 +10,16 @@ module Savon
10
10
  SOAPDateTimeRegexp = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/
11
11
 
12
12
  # Raised in case of an HTTP error.
13
- class HTTPError < StandardError; end
13
+ class HTTPError < StandardError
14
+
15
+ attr_reader :headers
16
+
17
+ def initialize(message, headers)
18
+ super(message)
19
+ @headers = headers
20
+ end
21
+
22
+ end
14
23
 
15
24
  # Raised in case of a SOAP fault.
16
25
  class SOAPFault < StandardError
@@ -72,7 +72,7 @@ module Savon
72
72
  def handle_soap_fault
73
73
  if soap_fault_message
74
74
  @soap_fault = soap_fault_message
75
- @soap_error_code = Integer(((to_hash[:fault] || {})[:detail] || {})[:errorcode])
75
+ @soap_error_code = Integer(((to_hash[:fault] || {})[:detail] || {})[:errorcode] || 0)
76
76
  raise Savon::SOAPFault.new(@soap_fault, @soap_error_code) if self.class.raise_errors?
77
77
  end
78
78
  end
@@ -104,7 +104,7 @@ module Savon
104
104
  if @http.code.to_i >= 300
105
105
  @http_error = "#{@http.message} (#{@http.code})"
106
106
  @http_error << ": #{@http.body}" unless @http.body.empty?
107
- raise Savon::HTTPError, http_error if self.class.raise_errors?
107
+ raise Savon::HTTPError.new(http_error, @http.to_hash) if self.class.raise_errors?
108
108
  end
109
109
  end
110
110
 
data/lib/savon/wsdl.rb CHANGED
@@ -47,6 +47,7 @@ module Savon
47
47
 
48
48
  # Returns the raw WSDL document.
49
49
  def to_s
50
+ # TODO: this class fails completely when the URL for the WSDL redirects
50
51
  @document ||= @request.wsdl.body
51
52
  end
52
53
 
@@ -91,7 +92,6 @@ module Savon
91
92
 
92
93
  @section = tag.to_sym if @depth <= 2 && Sections.include?(tag)
93
94
  @namespace_uri ||= attrs["targetNamespace"] if @section == :definitions
94
-
95
95
  @soap_endpoint ||= URI(URI.escape(attrs["location"])) if @section == :service && tag == "address"
96
96
 
97
97
  operation_from tag, attrs if @section == :binding && tag == "operation"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: savon-xaop
3
3
  version: !ruby/object:Gem::Version
4
- hash: 117
4
+ hash: 115
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
9
  - 2
10
- - 5
11
- version: 0.7.2.5
10
+ - 6
11
+ version: 0.7.2.6
12
12
  platform: ruby
13
13
  authors:
14
14
  - Daniel Harrington