Help the soap with basic ssl authentication and client certificates

Hi everyone, I am trying to send a simple request to a secure wsdl and web service using ssl, client certificates and basic authentication.

Here is the code

require 'savon' client = Savon::Client.new "https://example.com/service?wsdl" client.request.http.ssl_client_auth( :cert => OpenSSL::X509::Certificate.new(File.read("cert.pem")), :key => OpenSSL::PKey::RSA.new(File.read("key.pem")), :verify_mode => OpenSSL::SSL::VERIFY_NONE ) client.request.basic_auth "User", "Password" response = client.AddCustomer |soap| soap.body = { :Channel => 0, :tel => '34567', :id => '597118125', :paymentMode => 1, :Alias => 666, :flag => 0 } puts response.to_xml 

and a working test shell using soapUI:

 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mov="http://www.example.com/services/"> <soapenv:Header/> <soapenv:Body> <asd:AddCustomer> <Channel>0</idChannel> <tel>12344</msisdn> <id>59711</idIssuer> <paymentMode>1</paymentMode> <Alias>666</idAlias> <flag>0</flagPrivacy> </asd:AddCustomer> </soapenv:Body> </soapenv:Envelope> 

When I run my code, I get this error:

 method_missing': undefined method `AddCustomer' for #<Savon::Client:0x8abec08> 
+4
source share
1 answer

try to print the following - or just do it in irb

 client.wsdl.soap_actions 

I assume you will see that AddCustomer is not the same. This was probably changed to something like add_customer.

+3
source

Source: https://habr.com/ru/post/1300445/


All Articles