I recently update on savon 2.0.2 and I'm using it for sending some xml via soap. I have to use certificates but after updating the syntax of the new savon version the certificates are ignored. Could someone help me with the new syntax - I'm probably missing something... I'm running ruby 1.9.3 and rails 3.2.9
Old (working) version:
client = Savon::Client.new do | wsdl |
wsdl.endpoint = CONFIG['endpoint']
wsdl.namespace = CONFIG['namespace']
end
response = client.request(:ns, :getToken) do
http.auth.ssl.cert = OpenSSL::X509::Certificate.new(
File.read(Rails.root + "lib/certs/cert.pem"))
http.auth.ssl.cert_key_file = Rails.root + "lib/certs/key.pem"
http.auth.ssl.verify_mode = :none
soap.body = {
// body
}
soap.header={
"ns:account"=>{
:login=>CONFIG['login'],
:password=>CONFIG['password']
}
}
end
Now I tried to do exactly the same in 2.0.2, but it's not working - xml is ok, but certificate is being ignored...
so far I got:
client = Savon.client do
endpoint CONFIG['endpoint']
namespace CONFIG['namespace']
namespace_identifier :ns
ssl_cert_file OpenSSL::X509::Certificate.new(File.read(Rails.root + "lib/certs/cert.pem"))
ssl_cert_key_file Rails.root + "lib/certs/key.pem"
ssl_verify_mode :none
soap_header(
"sus:account"=>{
:login=>CONFIG['login'],
:password=>CONFIG['password']
}
)
end
response = client.call(:getToken) do
message(
// body
)
end
Any help would be very appreciated!!!