handsoap 1.1.7 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,4 +7,4 @@ To make a release, do:
7
7
  rake build
8
8
  gem push pkg/handsoap-*.gem
9
9
 
10
- You need `jeweleer` and `gemcutter`, as well as login credentials for gemcutter.
10
+ You need `jeweler` and `gemcutter`, as well as login credentials for gemcutter.
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 7
3
2
  :major: 1
4
3
  :minor: 1
5
4
  :build:
5
+ :patch: 8
@@ -39,6 +39,10 @@ module Handsoap
39
39
  if request.username && request.password
40
40
  http_client.userpwd = [request.username, ":", request.password].join
41
41
  end
42
+ http_client.cacert = request.trust_ca_file if request.trust_ca_file
43
+ http_client.cert = request.client_cert_file if request.client_cert_file
44
+ # I have submitted a patch for this to curb, but it's not yet supported. If you get errors, try upgrading curb.
45
+ http_client.cert_key = request.client_cert_key_file if request.client_cert_key_file
42
46
  # pack headers
43
47
  headers = request.headers.inject([]) do |arr, (k,v)|
44
48
  arr + v.map {|x| "#{k}: #{x}" }
@@ -32,6 +32,7 @@ module Handsoap
32
32
  http_client = Net::HTTP.new(url.host, url.port)
33
33
 
34
34
  #http_client.read_timeout = 120
35
+ http_client.open_timeout = Handsoap.timeout
35
36
  http_client.read_timeout = Handsoap.timeout
36
37
 
37
38
  http_client.use_ssl = true if url.scheme == 'https'
@@ -214,7 +214,7 @@ module Handsoap
214
214
  # +String+ sends a SOAPAction http header.
215
215
  #
216
216
  # +nil+ sends no SOAPAction http header.
217
- def invoke(action, options = { :soap_action => :auto }, &block) # :yields: Handsoap::XmlMason::Element
217
+ def invoke(action, options = { :soap_action => :auto, :http_options => nil }, &block) # :yields: Handsoap::XmlMason::Element
218
218
  if action
219
219
  if options.kind_of? String
220
220
  options = { :soap_action => options }
@@ -241,11 +241,11 @@ module Handsoap
241
241
  end
242
242
  # ready to dispatch
243
243
  headers = {
244
- "Content-Type" => "#{self.request_content_type};charset=UTF-8"
244
+ "Content-Type" => "#{self.request_content_type}; charset=UTF-8"
245
245
  }
246
246
  headers["SOAPAction"] = options[:soap_action] unless options[:soap_action].nil?
247
247
  on_before_dispatch
248
- request = make_http_request(self.uri, doc.to_s, headers,options[:http_options])
248
+ request = make_http_request(self.uri, doc.to_s, headers, options[:http_options])
249
249
  response = http_driver_instance.send_http_request(request)
250
250
  parse_http_response(response)
251
251
  end
@@ -287,7 +287,7 @@ module Handsoap
287
287
  dispatcher.request_block.call doc.find(action)
288
288
  # ready to dispatch
289
289
  headers = {
290
- "Content-Type" => "#{self.request_content_type};charset=UTF-8"
290
+ "Content-Type" => "#{self.request_content_type}; charset=UTF-8"
291
291
  }
292
292
  headers["SOAPAction"] = options[:soap_action] unless options[:soap_action].nil?
293
293
  on_before_dispatch
@@ -399,13 +399,13 @@ module Handsoap
399
399
  end
400
400
  end
401
401
 
402
- def make_http_request(uri, post_body, headers,http_options=nil)
402
+ def make_http_request(uri, post_body, headers, http_options=nil)
403
403
  request = Handsoap::Http::Request.new(uri, :post)
404
404
 
405
405
  # SSL CA AND CLIENT CERTIFICATES
406
406
  if http_options
407
407
  request.set_trust_ca_file(http_options[:trust_ca_file]) if http_options[:trust_ca_file]
408
- request.set_client_cert_files(http_options[:client_cert_file],http_options[:client_cert_key_file]) if http_options[:client_cert_file] && http_options[:client_cert_key_file]
408
+ request.set_client_cert_files(http_options[:client_cert_file], http_options[:client_cert_key_file]) if http_options[:client_cert_file] && http_options[:client_cert_key_file]
409
409
  end
410
410
 
411
411
  headers.each do |key, value|
@@ -92,6 +92,9 @@ module Handsoap
92
92
  def node_name
93
93
  self.first.node_name if self.any?
94
94
  end
95
+ def node_namespace
96
+ self.first.node_namespace if self.any?
97
+ end
95
98
  def xpath(expression, ns = nil)
96
99
  self.first.xpath(expression, ns)
97
100
  end
@@ -172,6 +175,11 @@ module Handsoap
172
175
  def node_name
173
176
  raise NotImplementedError.new
174
177
  end
178
+ # Returns the node namespace uri of the current element if any, +nil+ otherwise.
179
+ # Result returned for attribute nodes varies for different drivers, currently.
180
+ def node_namespace
181
+ raise NotImplementedError.new
182
+ end
175
183
  # Queries the document with XPath, relative to the current element.
176
184
  #
177
185
  # +ns+ Should be a Hash of prefix => namespace
@@ -216,6 +224,13 @@ module Handsoap
216
224
  def node_name
217
225
  @element.name
218
226
  end
227
+ def node_namespace
228
+ if @element.respond_to? :namespaces
229
+ if namespace = @element.namespaces.namespace
230
+ namespace.href
231
+ end
232
+ end
233
+ end
219
234
  def xpath(expression, ns = nil)
220
235
  ns = {} if ns.nil?
221
236
  ns = @namespaces.merge(ns)
@@ -256,6 +271,13 @@ module Handsoap
256
271
  @element.class.name.gsub(/.*::([^:]+)$/, "\\1").downcase
257
272
  end
258
273
  end
274
+ def node_namespace
275
+ if @element.respond_to? :namespace
276
+ namespace = @element.namespace
277
+ return if namespace == ''
278
+ end
279
+ namespace
280
+ end
259
281
  def xpath(expression, ns = nil)
260
282
  ns = {} if ns.nil?
261
283
  ns = @namespaces.merge(ns)
@@ -297,6 +319,9 @@ module Handsoap
297
319
  def node_name
298
320
  @element.name
299
321
  end
322
+ def node_namespace
323
+ @element.namespace.href if @element.namespace
324
+ end
300
325
  def xpath(expression, ns = nil)
301
326
  ns = {} if ns.nil?
302
327
  ns = @namespaces.merge(ns)
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handsoap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 1
8
+ - 8
9
+ version: 1.1.8
5
10
  platform: ruby
6
11
  authors:
7
12
  - Troels Knak-Nielsen
@@ -10,7 +15,7 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2010-02-11 00:00:00 +01:00
18
+ date: 2011-01-07 00:00:00 +01:00
14
19
  default_executable:
15
20
  dependencies: []
16
21
 
@@ -62,14 +67,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
62
67
  requirements:
63
68
  - - ">="
64
69
  - !ruby/object:Gem::Version
70
+ segments:
71
+ - 0
65
72
  version: "0"
66
- version:
67
73
  required_rubygems_version: !ruby/object:Gem::Requirement
68
74
  requirements:
69
75
  - - ">="
70
76
  - !ruby/object:Gem::Version
77
+ segments:
78
+ - 0
71
79
  version: "0"
72
- version:
73
80
  requirements:
74
81
  - |-
75
82
  You need to install either "curb" or "httpclient", using one of:
@@ -77,7 +84,7 @@ requirements:
77
84
  gem install httpclient
78
85
  - It is recommended that you install either "nokogiri" or "libxml-ruby"
79
86
  rubyforge_project:
80
- rubygems_version: 1.3.5
87
+ rubygems_version: 1.3.6
81
88
  signing_key:
82
89
  specification_version: 3
83
90
  summary: Handsoap is a library for creating SOAP clients in Ruby