savon-xaop 0.7.2.4 → 0.7.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,9 +35,12 @@ module Savon
35
35
  def soap_fault?
36
36
  @soap_fault ? true : false
37
37
  end
38
-
38
+
39
39
  # Returns the SOAP fault message.
40
40
  attr_reader :soap_fault
41
+
42
+ # Returns the SOAP error code
43
+ attr_reader :soap_error_code
41
44
 
42
45
  # Returns whether there was an HTTP error.
43
46
  def http_error?
@@ -59,7 +62,7 @@ module Savon
59
62
 
60
63
  # Returns the HTTP response object.
61
64
  attr_reader :http
62
-
65
+
63
66
  alias :to_s :to_xml
64
67
 
65
68
  private
@@ -69,7 +72,8 @@ module Savon
69
72
  def handle_soap_fault
70
73
  if soap_fault_message
71
74
  @soap_fault = soap_fault_message
72
- raise Savon::SOAPFault, @soap_fault if self.class.raise_errors?
75
+ @soap_error_code = Integer(((to_hash[:fault] || {})[:detail] || {})[:errorcode])
76
+ raise Savon::SOAPFault.new(@soap_fault, @soap_error_code) if self.class.raise_errors?
73
77
  end
74
78
  end
75
79
 
data/lib/savon/wsdl.rb CHANGED
@@ -91,6 +91,7 @@ module Savon
91
91
 
92
92
  @section = tag.to_sym if @depth <= 2 && Sections.include?(tag)
93
93
  @namespace_uri ||= attrs["targetNamespace"] if @section == :definitions
94
+
94
95
  @soap_endpoint ||= URI(URI.escape(attrs["location"])) if @section == :service && tag == "address"
95
96
 
96
97
  operation_from tag, attrs if @section == :binding && tag == "operation"
data/lib/savon.rb CHANGED
@@ -13,7 +13,16 @@ module Savon
13
13
  class HTTPError < StandardError; end
14
14
 
15
15
  # Raised in case of a SOAP fault.
16
- class SOAPFault < StandardError; end
16
+ class SOAPFault < StandardError
17
+
18
+ attr_reader :error_code
19
+
20
+ def initialize(message, error_code)
21
+ super(message)
22
+ @error_code = error_code
23
+ end
24
+
25
+ end
17
26
 
18
27
  end
19
28
 
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: 119
4
+ hash: 117
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
9
  - 2
10
- - 4
11
- version: 0.7.2.4
10
+ - 5
11
+ version: 0.7.2.5
12
12
  platform: ruby
13
13
  authors:
14
14
  - Daniel Harrington