soap-object 0.6.5 → 0.6.6

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
  SHA1:
3
- metadata.gz: 4840419c8ad272e60553541640ffa0c1b6acbf62
4
- data.tar.gz: 056fed9f50b3dcf5038a59caff85f6a5675a2cc9
3
+ metadata.gz: 785c015457c0fbbe6711f6248fe8eee88b666d02
4
+ data.tar.gz: cae6cf0f87fa4cf262d4ccfe17069a2d9a5a203d
5
5
  SHA512:
6
- metadata.gz: d04ca323b975ded1f20e1bfe9edb431bbf697c10f1237e864616c093ae180a96e5b5ad40d86a1ec40de0177fd17b3c7f1f9f7773bc09ac0400829842f3c789d7
7
- data.tar.gz: fd6d25c2e9861cead147b2bbcf1235b4887d9b0492006f83e30f22172ae22e8109354188d5f3bd01710660fa3725455c21f66349c94fb9da9711141c6f853e35
6
+ metadata.gz: 4d70412486da949526dd37cae85137b556ef673fa31c1b68389d1ca393dbd7fc17298337360e5a1d2a99a6bb97a6a9787aebec787e48bd93298f43ad91ff5ed8
7
+ data.tar.gz: e463946ab68aaa33677a1d8b42669cda152917a48e92090b0405688fb5e60b6b9fc97edb1b4b3ff59854ae2665b74fe657effaa8cf6318fc5501bc771f3473cf
data/.gitignore CHANGED
@@ -1,20 +1,20 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- *.swp
19
- TAGS
20
- .idea/
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.swp
19
+ TAGS
20
+ .idea/
data/.rspec CHANGED
@@ -1,2 +1,2 @@
1
- --color
1
+ --color
2
2
  --format doc
data/.ruby-gemset CHANGED
@@ -1 +1 @@
1
- soap-object
1
+ soap-object
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.0.0-p195
1
+ ruby-2.0.0-p195
data/ChangeLog CHANGED
@@ -1,59 +1,59 @@
1
- === Version 0.6.5 / 2015-6-3
2
- * Enhancements
3
- * Added ability to set soap version
4
-
5
- === Version 0.6.4 / 2015-4-22
6
- * Enhancements
7
- * SSL version is :SSLv3 by default
8
- * Added ability to set SSL version.
9
-
10
- === Version 0.6.3 / 2015-3-26
11
- * Enhancements
12
- * Added ability to disable ssl verification
13
-
14
- === Version 0.6.2 / 2015-3-12
15
- * Enhancements
16
- * Calling xpath on Savon response, to take advantage of namespace collecting from response.
17
-
18
- === Version 0.6.1 / 2015-3-12
19
- * Enhancements
20
- * Added xpath method to return to allow user to access path directly
21
-
22
- === Version 0.6 / 2014-12-22
23
- * Enhancements
24
- * Added ability to call operation with hand rolled xml
25
- * Disabled logging by default, setting log_level enables it
26
-
27
- === Version 0.5.1 / 2013-6-1
28
- * Enhancements
29
- * Added body method to return the body of the result as a Hash
30
-
31
- === Version 0.5 / 2013-6-1
32
- * Enhancements
33
- * Removed the body accessor
34
- * Removed the body_xml method
35
- * Added to_xml method to return the response as a String containing the XML
36
- * Added to_hash method to return the respons as a Hash
37
- * Added doc method to return response as a Nokogiri::XML::Document document
38
- * Updated method_missing so when services methods are called the raw XML is returned
39
-
40
- === Version 0.4 / 2013-3-18
41
- * Enhancements
42
- * Added body accessor to SoapObject to return raw body
43
- * Added body_xml method to SoapObject to return Nokogiri::XML::Document containing body
44
-
45
- === Version 0.3 / 2013-3-17
46
- * Enhancements
47
- * Added SoapObject::Factory to assist in creating new service objects
48
- * Added accessor for @response
49
-
50
- === Version 0.2 / 2013-3-11
51
- * Enhancements
52
- * Added ability to add XML to the soap header
53
- * Added ability to set the encoding for the messages
54
- * Added ability to use basic authentication
55
- * Added ability to use digest authentication
56
- * Added ability to set the log level
57
-
58
- === Version 0.1 / 2013-3-4
59
- Initial release
1
+ === Version 0.6.5 / 2015-6-3
2
+ * Enhancements
3
+ * Added ability to set soap version
4
+
5
+ === Version 0.6.4 / 2015-4-22
6
+ * Enhancements
7
+ * SSL version is :SSLv3 by default
8
+ * Added ability to set SSL version.
9
+
10
+ === Version 0.6.3 / 2015-3-26
11
+ * Enhancements
12
+ * Added ability to disable ssl verification
13
+
14
+ === Version 0.6.2 / 2015-3-12
15
+ * Enhancements
16
+ * Calling xpath on Savon response, to take advantage of namespace collecting from response.
17
+
18
+ === Version 0.6.1 / 2015-3-12
19
+ * Enhancements
20
+ * Added xpath method to return to allow user to access path directly
21
+
22
+ === Version 0.6 / 2014-12-22
23
+ * Enhancements
24
+ * Added ability to call operation with hand rolled xml
25
+ * Disabled logging by default, setting log_level enables it
26
+
27
+ === Version 0.5.1 / 2013-6-1
28
+ * Enhancements
29
+ * Added body method to return the body of the result as a Hash
30
+
31
+ === Version 0.5 / 2013-6-1
32
+ * Enhancements
33
+ * Removed the body accessor
34
+ * Removed the body_xml method
35
+ * Added to_xml method to return the response as a String containing the XML
36
+ * Added to_hash method to return the respons as a Hash
37
+ * Added doc method to return response as a Nokogiri::XML::Document document
38
+ * Updated method_missing so when services methods are called the raw XML is returned
39
+
40
+ === Version 0.4 / 2013-3-18
41
+ * Enhancements
42
+ * Added body accessor to SoapObject to return raw body
43
+ * Added body_xml method to SoapObject to return Nokogiri::XML::Document containing body
44
+
45
+ === Version 0.3 / 2013-3-17
46
+ * Enhancements
47
+ * Added SoapObject::Factory to assist in creating new service objects
48
+ * Added accessor for @response
49
+
50
+ === Version 0.2 / 2013-3-11
51
+ * Enhancements
52
+ * Added ability to add XML to the soap header
53
+ * Added ability to set the encoding for the messages
54
+ * Added ability to use basic authentication
55
+ * Added ability to use digest authentication
56
+ * Added ability to set the log level
57
+
58
+ === Version 0.1 / 2013-3-4
59
+ Initial release
data/Gemfile CHANGED
@@ -1,11 +1,11 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in soap-object.gemspec
4
-
5
- gem 'rake'
6
- gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
7
- gem 'growl'
8
- gem 'guard-rspec'
9
- gem 'guard-cucumber'
10
-
11
- gemspec
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in soap-object.gemspec
4
+
5
+ gem 'rake'
6
+ gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
7
+ gem 'growl'
8
+ gem 'guard-rspec'
9
+ gem 'guard-cucumber'
10
+
11
+ gemspec
data/Guardfile CHANGED
@@ -1,17 +1,17 @@
1
- # A sample Guardfile
2
- # More info at https://github.com/guard/guard#readme
3
-
4
- guard 'rspec', :cli => '--color --format doc' do
5
- watch(%r{^spec/.+_spec\.rb$})
6
- watch(%r{^lib/(.+)\.rb$}) { "spec" }
7
- watch('spec/spec_helper.rb') { "spec" }
8
- end
9
-
10
-
11
- guard 'cucumber', :notification => true, :all_after_pass => false, :cli => '--profile focus' do
12
- watch(%r{^features/.+\.feature$})
13
- watch(%r{^features/support/.+$}) { 'features' }
14
- watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
15
- watch(%r{^lib/.+\.rb$}) { "features" }
16
- watch(%r{^cucumber.yml$}) { "features" }
17
- end
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard 'rspec', :cli => '--color --format doc' do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { "spec" }
7
+ watch('spec/spec_helper.rb') { "spec" }
8
+ end
9
+
10
+
11
+ guard 'cucumber', :notification => true, :all_after_pass => false, :cli => '--profile focus' do
12
+ watch(%r{^features/.+\.feature$})
13
+ watch(%r{^features/support/.+$}) { 'features' }
14
+ watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
15
+ watch(%r{^lib/.+\.rb$}) { "features" }
16
+ watch(%r{^cucumber.yml$}) { "features" }
17
+ end
data/LICENSE.txt CHANGED
@@ -1,22 +1,22 @@
1
- Copyright (c) 2013 Jeffrey S. Morgan
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1
+ Copyright (c) 2013 Jeffrey S. Morgan
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
22
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,42 +1,102 @@
1
- # Soap::Object
2
-
3
- Module to make it simpler to tests SOAP web services. The goal is
4
- to abstract all information about how your call and parse results
5
- from the web service within the soap objects.
6
-
7
- ````ruby
8
- class AirportService
9
- include SoapObject
10
-
11
- wsdl 'http://www.webservicex.net/airport.asmx?WSDL'
12
-
13
- def get_airport_name_for(airport_code)
14
- response = get_airport_information_by_airport_code airport_code: airport_code
15
- doc = Nokogiri::XML(response)
16
- doc.xpath('//Table/CityOrAirportName').first.content
17
- end
18
- end
19
- ````
20
-
21
- ## Installation
22
-
23
- Add this line to your application's Gemfile:
24
-
25
- gem 'soap-object'
26
-
27
- And then execute:
28
-
29
- $ bundle
30
-
31
- Or install it yourself as:
32
-
33
- $ gem install soap-object
34
-
35
-
36
- ## Contributing
37
-
38
- 1. Fork it
39
- 2. Create your feature branch (`git checkout -b my-new-feature`)
40
- 3. Commit your changes (`git commit -am 'Add some feature'`)
41
- 4. Push to the branch (`git push origin my-new-feature`)
42
- 5. Create new Pull Request
1
+ # Soap::Object
2
+
3
+ Module to make it simpler to tests SOAP web services. The goal is
4
+ to abstract all information about how your call and parse results
5
+ from the web service within the soap objects.
6
+
7
+ ## Defining
8
+
9
+ ````ruby
10
+ class AirportService
11
+ include SoapObject
12
+
13
+ wsdl 'http://www.webservicex.net/airport.asmx?WSDL'
14
+
15
+ def airport_name
16
+ xpath('//Table/CityOrAirportName').first.content
17
+ end
18
+
19
+ end
20
+ ````
21
+
22
+ ## Usage
23
+
24
+ ````ruby
25
+ require 'soap-object'
26
+
27
+ service = AirportService.new
28
+
29
+ service.operations
30
+ #=> [:get_airport_information_by_iso_country_code,
31
+ # :get_airport_information_by_city_or_airport_name,
32
+ # :get_airport_information_by_country,
33
+ # :get_airport_information_by_airport_code]
34
+
35
+ service.get_airport_information_by_airport_code
36
+ #=> <Savon::Response>
37
+
38
+ ````
39
+
40
+ By default soap-object attempts to handle any missing method call by passing it through to the underlying Savon client. This enable the soap-object to handle calls to all operations on a given WSDL.
41
+
42
+
43
+ ## Using with Cucumber
44
+
45
+ Include the factory methods by placing the following line in the cucumber env.rb file.
46
+
47
+ ````ruby
48
+ World(SoapObject::Factory)
49
+ ````
50
+ By doing so, soap-object's methods are available in cucumbers step definitions.
51
+
52
+ ````ruby
53
+ When(/^I request the airport information for "([^"]*)"$/) do |airport_code|
54
+ using(AirportService).get_airport_information_by_airport_code({airport_code: airport_code})
55
+ end
56
+
57
+ Then(/^the airport name should be "([^"]*)"$/) do |airport_name|
58
+ expect(using(AirportService).airport_name).to be eq(airport_name)
59
+ end
60
+ ````
61
+
62
+ ## Parsing the response
63
+
64
+ Several methods exists on the soap-object to help parse the response.
65
+
66
+ Return the xml response
67
+ - to_xml
68
+
69
+ Return value at a specific path using xpath
70
+ - xpath(path)
71
+
72
+ Return the response as a Hash
73
+ - to_hash
74
+
75
+ Return the body of the message as a Hash
76
+ - body
77
+
78
+ Return the response as a Nokogiri document
79
+ - doc
80
+
81
+ ## Installation
82
+
83
+ Add this line to your application's Gemfile:
84
+
85
+ gem 'soap-object'
86
+
87
+ And then execute:
88
+
89
+ $ bundle
90
+
91
+ Or install it yourself as:
92
+
93
+ $ gem install soap-object
94
+
95
+
96
+ ## Contributing
97
+
98
+ 1. Fork it
99
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
100
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
101
+ 4. Push to the branch (`git push origin my-new-feature`)
102
+ 5. Create new Pull Request
data/Rakefile CHANGED
@@ -1,21 +1,20 @@
1
- require "bundler/gem_tasks"
2
-
3
- require 'rspec/core/rake_task'
4
- require 'cucumber'
5
- require 'cucumber/rake/task'
6
-
7
- RSpec::Core::RakeTask.new(:spec) do |spec|
8
- spec.ruby_opts = "-I lib:spec"
9
- spec.pattern = 'spec/**/*_spec.rb'
10
- end
11
- task :spec
12
-
13
- Cucumber::Rake::Task.new(:features, "Run all features") do |t|
14
- t.profile = 'focus'
15
- end
16
-
17
- desc 'Run all specs and features'
18
- task :test => %w[spec features]
19
-
20
- task :default => :test
21
-
1
+ require "bundler/gem_tasks"
2
+
3
+ require 'rspec/core/rake_task'
4
+ require 'cucumber'
5
+ require 'cucumber/rake/task'
6
+
7
+ RSpec::Core::RakeTask.new(:spec) do |spec|
8
+ spec.ruby_opts = "-I lib:spec"
9
+ spec.pattern = 'spec/**/*_spec.rb'
10
+ end
11
+ task :spec
12
+
13
+ Cucumber::Rake::Task.new(:features, "Run all features") do |t|
14
+ t.profile = 'focus'
15
+ end
16
+
17
+ desc 'Run all specs and features'
18
+ task :test => %w[spec features]
19
+
20
+ task :default => :test