s-savon 0.8.6

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.
Files changed (61) hide show
  1. data/.gitignore +9 -0
  2. data/.rspec +1 -0
  3. data/.yardopts +2 -0
  4. data/CHANGELOG.md +461 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE +20 -0
  7. data/README.md +37 -0
  8. data/Rakefile +40 -0
  9. data/lib/savon.rb +14 -0
  10. data/lib/savon/client.rb +157 -0
  11. data/lib/savon/core_ext/hash.rb +70 -0
  12. data/lib/savon/core_ext/object.rb +14 -0
  13. data/lib/savon/core_ext/string.rb +51 -0
  14. data/lib/savon/core_ext/time.rb +14 -0
  15. data/lib/savon/error.rb +6 -0
  16. data/lib/savon/global.rb +75 -0
  17. data/lib/savon/http/error.rb +42 -0
  18. data/lib/savon/soap.rb +24 -0
  19. data/lib/savon/soap/fault.rb +59 -0
  20. data/lib/savon/soap/request.rb +61 -0
  21. data/lib/savon/soap/response.rb +80 -0
  22. data/lib/savon/soap/xml.rb +187 -0
  23. data/lib/savon/version.rb +5 -0
  24. data/lib/savon/wsdl/document.rb +112 -0
  25. data/lib/savon/wsdl/parser.rb +102 -0
  26. data/lib/savon/wsdl/request.rb +35 -0
  27. data/lib/savon/wsse.rb +150 -0
  28. data/savon.gemspec +29 -0
  29. data/spec/fixtures/gzip/message.gz +0 -0
  30. data/spec/fixtures/response/another_soap_fault.xml +14 -0
  31. data/spec/fixtures/response/authentication.xml +14 -0
  32. data/spec/fixtures/response/header.xml +13 -0
  33. data/spec/fixtures/response/list.xml +18 -0
  34. data/spec/fixtures/response/multi_ref.xml +39 -0
  35. data/spec/fixtures/response/soap_fault.xml +8 -0
  36. data/spec/fixtures/response/soap_fault12.xml +18 -0
  37. data/spec/fixtures/wsdl/authentication.xml +63 -0
  38. data/spec/fixtures/wsdl/geotrust.xml +156 -0
  39. data/spec/fixtures/wsdl/namespaced_actions.xml +307 -0
  40. data/spec/fixtures/wsdl/no_namespace.xml +115 -0
  41. data/spec/fixtures/wsdl/two_bindings.xml +25 -0
  42. data/spec/savon/client_spec.rb +346 -0
  43. data/spec/savon/core_ext/hash_spec.rb +121 -0
  44. data/spec/savon/core_ext/object_spec.rb +19 -0
  45. data/spec/savon/core_ext/string_spec.rb +57 -0
  46. data/spec/savon/core_ext/time_spec.rb +13 -0
  47. data/spec/savon/http/error_spec.rb +52 -0
  48. data/spec/savon/savon_spec.rb +85 -0
  49. data/spec/savon/soap/fault_spec.rb +89 -0
  50. data/spec/savon/soap/request_spec.rb +45 -0
  51. data/spec/savon/soap/response_spec.rb +174 -0
  52. data/spec/savon/soap/xml_spec.rb +335 -0
  53. data/spec/savon/soap_spec.rb +21 -0
  54. data/spec/savon/wsdl/document_spec.rb +132 -0
  55. data/spec/savon/wsdl/parser_spec.rb +99 -0
  56. data/spec/savon/wsdl/request_spec.rb +15 -0
  57. data/spec/savon/wsse_spec.rb +213 -0
  58. data/spec/spec_helper.rb +14 -0
  59. data/spec/support/endpoint.rb +25 -0
  60. data/spec/support/fixture.rb +37 -0
  61. metadata +251 -0
@@ -0,0 +1,14 @@
1
+ require "bundler"
2
+ Bundler.require :default, :development
3
+
4
+ RSpec.configure do |config|
5
+ config.mock_with :mocha
6
+ end
7
+
8
+ require "savon"
9
+
10
+ # Disable logging for specs.
11
+ Savon.log = false
12
+
13
+ require "support/endpoint"
14
+ require "support/fixture"
@@ -0,0 +1,25 @@
1
+ class Endpoint
2
+ class << self
3
+
4
+ # Returns the WSDL endpoint for a given +type+ of request.
5
+ def wsdl(type = nil)
6
+ case type
7
+ when :no_namespace then "http://nons.example.com/Service?wsdl"
8
+ when :namespaced_actions then "http://nsactions.example.com/Service?wsdl"
9
+ when :geotrust then "https://test-api.geotrust.com/webtrust/query.jws?WSDL"
10
+ else soap(type)
11
+ end
12
+ end
13
+
14
+ # Returns the SOAP endpoint for a given +type+ of request.
15
+ def soap(type = nil)
16
+ case type
17
+ when :soap_fault then "http://soapfault.example.com/Service?wsdl"
18
+ when :http_error then "http://httperror.example.com/Service?wsdl"
19
+ when :invalid then "http://invalid.example.com/Service?wsdl"
20
+ else "http://example.com/validation/1.0/AuthenticationService"
21
+ end
22
+ end
23
+
24
+ end
25
+ end
@@ -0,0 +1,37 @@
1
+ class Fixture
2
+
3
+ TYPES = { :gzip => "gz", :response => "xml", :wsdl => "xml" }
4
+
5
+ class << self
6
+
7
+ def [](type, fixture)
8
+ fixtures(type)[fixture] ||= read_file type, fixture
9
+ end
10
+
11
+ def response_hash(fixture)
12
+ @response_hash ||= {}
13
+ @response_hash[fixture] ||= Savon::SOAP::XML.to_hash response(fixture)
14
+ end
15
+
16
+ TYPES.each do |type, ext|
17
+ define_method type do |fixture|
18
+ self[type, fixture]
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ def fixtures(type)
25
+ @fixtures ||= {}
26
+ @fixtures[type] ||= {}
27
+ end
28
+
29
+ def read_file(type, fixture)
30
+ path = File.expand_path "../../fixtures/#{type}/#{fixture}.#{TYPES[type]}", __FILE__
31
+ raise ArgumentError, "Unable to load: #{path}" unless File.exist? path
32
+
33
+ File.read path
34
+ end
35
+
36
+ end
37
+ end
metadata ADDED
@@ -0,0 +1,251 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: s-savon
3
+ version: !ruby/object:Gem::Version
4
+ hash: 51
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 8
9
+ - 6
10
+ version: 0.8.6
11
+ platform: ruby
12
+ authors:
13
+ - Daniel Harrington
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-04-21 00:00:00 +03:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: builder
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 15
30
+ segments:
31
+ - 2
32
+ - 1
33
+ - 2
34
+ version: 2.1.2
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: crack
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ hash: 11
46
+ segments:
47
+ - 0
48
+ - 1
49
+ - 8
50
+ version: 0.1.8
51
+ type: :runtime
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: httpi
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 19
62
+ segments:
63
+ - 0
64
+ - 7
65
+ - 8
66
+ version: 0.7.8
67
+ type: :runtime
68
+ version_requirements: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ name: gyoku
71
+ prerelease: false
72
+ requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ hash: 19
78
+ segments:
79
+ - 0
80
+ - 3
81
+ - 0
82
+ version: 0.3.0
83
+ type: :runtime
84
+ version_requirements: *id004
85
+ - !ruby/object:Gem::Dependency
86
+ name: rspec
87
+ prerelease: false
88
+ requirement: &id005 !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ hash: 31
94
+ segments:
95
+ - 2
96
+ - 4
97
+ - 0
98
+ version: 2.4.0
99
+ type: :development
100
+ version_requirements: *id005
101
+ - !ruby/object:Gem::Dependency
102
+ name: autotest
103
+ prerelease: false
104
+ requirement: &id006 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ hash: 3
110
+ segments:
111
+ - 0
112
+ version: "0"
113
+ type: :development
114
+ version_requirements: *id006
115
+ - !ruby/object:Gem::Dependency
116
+ name: mocha
117
+ prerelease: false
118
+ requirement: &id007 !ruby/object:Gem::Requirement
119
+ none: false
120
+ requirements:
121
+ - - ~>
122
+ - !ruby/object:Gem::Version
123
+ hash: 43
124
+ segments:
125
+ - 0
126
+ - 9
127
+ - 8
128
+ version: 0.9.8
129
+ type: :development
130
+ version_requirements: *id007
131
+ - !ruby/object:Gem::Dependency
132
+ name: timecop
133
+ prerelease: false
134
+ requirement: &id008 !ruby/object:Gem::Requirement
135
+ none: false
136
+ requirements:
137
+ - - ~>
138
+ - !ruby/object:Gem::Version
139
+ hash: 25
140
+ segments:
141
+ - 0
142
+ - 3
143
+ - 5
144
+ version: 0.3.5
145
+ type: :development
146
+ version_requirements: *id008
147
+ description: Savon is the heavy metal Ruby SOAP client.
148
+ email: me@rubiii.com
149
+ executables: []
150
+
151
+ extensions: []
152
+
153
+ extra_rdoc_files: []
154
+
155
+ files:
156
+ - .gitignore
157
+ - .rspec
158
+ - .yardopts
159
+ - CHANGELOG.md
160
+ - Gemfile
161
+ - LICENSE
162
+ - README.md
163
+ - Rakefile
164
+ - lib/savon.rb
165
+ - lib/savon/client.rb
166
+ - lib/savon/core_ext/hash.rb
167
+ - lib/savon/core_ext/object.rb
168
+ - lib/savon/core_ext/string.rb
169
+ - lib/savon/core_ext/time.rb
170
+ - lib/savon/error.rb
171
+ - lib/savon/global.rb
172
+ - lib/savon/http/error.rb
173
+ - lib/savon/soap.rb
174
+ - lib/savon/soap/fault.rb
175
+ - lib/savon/soap/request.rb
176
+ - lib/savon/soap/response.rb
177
+ - lib/savon/soap/xml.rb
178
+ - lib/savon/version.rb
179
+ - lib/savon/wsdl/document.rb
180
+ - lib/savon/wsdl/parser.rb
181
+ - lib/savon/wsdl/request.rb
182
+ - lib/savon/wsse.rb
183
+ - savon.gemspec
184
+ - spec/fixtures/gzip/message.gz
185
+ - spec/fixtures/response/another_soap_fault.xml
186
+ - spec/fixtures/response/authentication.xml
187
+ - spec/fixtures/response/header.xml
188
+ - spec/fixtures/response/list.xml
189
+ - spec/fixtures/response/multi_ref.xml
190
+ - spec/fixtures/response/soap_fault.xml
191
+ - spec/fixtures/response/soap_fault12.xml
192
+ - spec/fixtures/wsdl/authentication.xml
193
+ - spec/fixtures/wsdl/geotrust.xml
194
+ - spec/fixtures/wsdl/namespaced_actions.xml
195
+ - spec/fixtures/wsdl/no_namespace.xml
196
+ - spec/fixtures/wsdl/two_bindings.xml
197
+ - spec/savon/client_spec.rb
198
+ - spec/savon/core_ext/hash_spec.rb
199
+ - spec/savon/core_ext/object_spec.rb
200
+ - spec/savon/core_ext/string_spec.rb
201
+ - spec/savon/core_ext/time_spec.rb
202
+ - spec/savon/http/error_spec.rb
203
+ - spec/savon/savon_spec.rb
204
+ - spec/savon/soap/fault_spec.rb
205
+ - spec/savon/soap/request_spec.rb
206
+ - spec/savon/soap/response_spec.rb
207
+ - spec/savon/soap/xml_spec.rb
208
+ - spec/savon/soap_spec.rb
209
+ - spec/savon/wsdl/document_spec.rb
210
+ - spec/savon/wsdl/parser_spec.rb
211
+ - spec/savon/wsdl/request_spec.rb
212
+ - spec/savon/wsse_spec.rb
213
+ - spec/spec_helper.rb
214
+ - spec/support/endpoint.rb
215
+ - spec/support/fixture.rb
216
+ has_rdoc: true
217
+ homepage: http://github.com/rubiii/s-savon
218
+ licenses: []
219
+
220
+ post_install_message:
221
+ rdoc_options: []
222
+
223
+ require_paths:
224
+ - lib
225
+ required_ruby_version: !ruby/object:Gem::Requirement
226
+ none: false
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ hash: 3
231
+ segments:
232
+ - 0
233
+ version: "0"
234
+ required_rubygems_version: !ruby/object:Gem::Requirement
235
+ none: false
236
+ requirements:
237
+ - - ">="
238
+ - !ruby/object:Gem::Version
239
+ hash: 3
240
+ segments:
241
+ - 0
242
+ version: "0"
243
+ requirements: []
244
+
245
+ rubyforge_project: s-savon
246
+ rubygems_version: 1.5.2
247
+ signing_key:
248
+ specification_version: 3
249
+ summary: Heavy metal Ruby SOAP client
250
+ test_files: []
251
+