Skip to content

Commit

Permalink
added validate presence of http_options and options[:soap_header], th…
Browse files Browse the repository at this point in the history
…e gem works again
  • Loading branch information
Peter Ericson committed Jan 16, 2010
1 parent 13131a5 commit 63943c6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/handsoap/service.rb
Expand Up @@ -225,8 +225,10 @@ def invoke(action, options = { :soap_action => :auto }, &block) # :yields: Hands
options[:soap_action] = nil
end
doc = make_envelope do |body,header|
options[:soap_header].each_pair do |k,v|
header.add k,v
if options[:soap_header]
options[:soap_header].each_pair do |k,v|
header.add k,v
end
end

body.add action
Expand Down Expand Up @@ -376,8 +378,10 @@ def make_http_request(uri, post_body, headers,http_options=nil)
request = Handsoap::Http::Request.new(uri, :post)

# SSL CA AND CLIENT CERTIFICATES
request.set_trust_ca_file(http_options[:trust_ca_file])
request.set_client_cert_files(http_options[:client_cert_file],http_options[:client_cert_key_file])
if http_options
request.set_trust_ca_file(http_options[:trust_ca_file]) if http_options[:trust_ca_file]
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]
end

headers.each do |key, value|
request.add_header(key, value)
Expand Down

0 comments on commit 63943c6

Please sign in to comment.