Hi,
Here''s an update in case it can help someone else later.
So I needed to make SOAP request over HTTPS. I just had a crt file from
the SOAP server.
Besides soap4r plugin I required the next as well
require "soap/wsdlDriver"
require ''http-access2''
--------------
My SOAP request needed also basic auth as well, and I only managed to
include those headers using this:
class HTTP::Message::Headers
alias :__set_header__ :set_header unless
method_defined?(:set_header)
def set_header
__set_header__
set(''Authorization'',''Basic
czsddddddddsdsdsdsdsyMzQ='')
end
end
--------------
I placed the cert I got into <myappname>/certs folder
I created a file called "property" into <myappname>/lib/soap and
added
the cert info so soap4r plugin gets it:
client.protocol.http.ssl_config.ca_file = <path to your cert>
---------------
To make the SOAP request I did the next:
wsdl = ''https://xxx.xxx.xxx.xxx/soap/services''
factory = SOAP::RPC::Driver.new(wsdl)
factory.add_method(''getServices'', ''<parameter
names separated by
comma>'')
factory.wiredump_dev = STDERR <--- so useful to see the SOAP messages
result = factory.getServices(<parameters>)
Cheers
--
Posted via http://www.ruby-forum.com/.