savon 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -6,11 +6,15 @@ alternative to other libraries.
6
6
 
7
7
  == Install
8
8
 
9
- $ gem install rubiii-savon -s http://gems.github.com
9
+ The gem for Savon is in the {gemcutter}[http://gemcutter.org] repository.
10
+ Please follow the steps on their website to set up your rubygems installation.
11
+ Afterwards you can install the gem like this:
12
+
13
+ $ gem install savon
10
14
 
11
15
  == Dependencies
12
16
 
13
- rubiii-apricoteatsgorilla >= 0.5.2
17
+ rubiii-apricoteatsgorilla >= 0.5.10
14
18
  hpricot 0.8.241 (the latest JRuby-compatible version)
15
19
 
16
20
  Hpricot 0.8.241 is also available at: {Apricot eats Gorilla Downloads}[http://github.com/rubiii/apricoteatsgorilla/downloads]
data/Rakefile CHANGED
@@ -38,7 +38,7 @@ begin
38
38
  ]
39
39
 
40
40
  spec.add_runtime_dependency("hpricot", "0.8.241")
41
- spec.add_runtime_dependency("apricoteatsgorilla", "0.5.9")
41
+ spec.add_runtime_dependency("apricoteatsgorilla", "0.5.10")
42
42
 
43
43
  spec.add_development_dependency("rspec", ">= 1.2.8")
44
44
  spec.add_development_dependency("rr", ">= 0.10.0")
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.8
1
+ 0.2.9
data/lib/savon/service.rb CHANGED
@@ -25,7 +25,10 @@ module Savon
25
25
  attr_accessor :wsse_password
26
26
 
27
27
  # Sets whether the WSSE password should be encrypted.
28
- attr_writer :wsse_password_digest
28
+ attr_writer :wsse_digest
29
+
30
+ # Sets whether the response should be returned as is.
31
+ attr_writer :pure_response
29
32
 
30
33
  # Initializer expects an +endpoint+ URI and takes an optional SOAP +version+.
31
34
  def initialize(endpoint, version = 1)
@@ -41,8 +44,13 @@ module Savon
41
44
  end
42
45
 
43
46
  # Returns whether the WSSE password should be encrypted. Defaults to +false+.
44
- def wsse_password_digest?
45
- @wsse_password_digest == true
47
+ def wsse_digest?
48
+ @wsse_digest == true
49
+ end
50
+
51
+ # Returns whether the response should be returned as is. Defaults to +false+.
52
+ def pure_response?
53
+ @pure_response == true
46
54
  end
47
55
 
48
56
  private
@@ -66,14 +74,18 @@ module Savon
66
74
  raise_soap_fault(soap_fault) if soap_fault && !soap_fault.empty?
67
75
  raise_http_error(response) if response.code.to_i >= 300
68
76
 
69
- ApricotEatsGorilla[response.body, response_xpath]
77
+ if pure_response?
78
+ response.body
79
+ else
80
+ ApricotEatsGorilla[response.body, response_xpath]
81
+ end
70
82
  end
71
83
 
72
84
  # Expects the requested +soap_action+ and +soap_body+ and builds and
73
85
  # returns the request header and body to dispatch a SOAP request.
74
86
  def build_request_parameters(soap_action, soap_body)
75
87
  headers = { "Content-Type" => ContentType[@version], "SOAPAction" => soap_action }
76
- namespaces = { :wsdl => wsdl.namespace_uri }
88
+ namespaces = { "xmlns:wsdl" => wsdl.namespace_uri }
77
89
 
78
90
  body = ApricotEatsGorilla.soap_envelope(namespaces, wsse, @version) do
79
91
  ApricotEatsGorilla["wsdl:#{soap_action}" => soap_body]
@@ -84,8 +96,7 @@ module Savon
84
96
  # Returns the WSSE arguments if :wsse_username and :wsse_password are set.
85
97
  def wsse
86
98
  if @wsse_username && @wsse_password
87
- { :username => @wsse_username, :password => @wsse_password,
88
- :password_digest => wsse_password_digest? }
99
+ { :username => @wsse_username, :password => @wsse_password, :digest => wsse_digest? }
89
100
  else
90
101
  nil
91
102
  end
@@ -67,5 +67,10 @@ describe Savon::Service do
67
67
  @service = new_service_instance(:soap_fault => true, :http_error => true)
68
68
  lambda { @service.find_user }.should raise_error(Savon::SOAPFault)
69
69
  end
70
+
71
+ it "returns the raw response body when :pure_response was set to +true+" do
72
+ @service.pure_response = true
73
+ @service.find_user.should == UserFixture.user_response
74
+ end
70
75
  end
71
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: savon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Harrington
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-06 00:00:00 +02:00
12
+ date: 2009-10-08 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - "="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.5.9
33
+ version: 0.5.10
34
34
  version:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: rspec