I have a wsdl client that will work standalone but as soon as I put
identical code into a Rails controller I get an Errno::ECONNREFUSED
#(Connection refused -connect(2)…) Any ideas?
=======================
||Standalone: (works) ||
require 'soap/wsdlDriver'
require 'http-access2'
user = 'fwkaufm'
wsdl = 'ProxyUser.wsdl'
soap = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
soap.options['protocol.http.ssl_config.client_cert'] =
‘/etc/certs/ssl.crt/server_cert.crt’
soap.options[‘protocol.http.ssl_config.client_key’]=’/etc/certs/ssl.crt/server_key_nopass.pem’
soap.options[‘protocol.http.ssl_config.ca_file’]=’/etc/certs/ssl.crt/ca.crt’
dn = soap.getDn(user)
puts dn
=======================================
||Behind a Controller: (Doesn’t work) ||
require ‘soap/wsdlDriver’
require ‘http-access2’
class WebserviceTestController < ApplicationController
def connection
user = ‘fwkaufm’
wsdl = ‘ProxyUser.wsdl’
soap = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
soap.options['protocol.http.ssl_config.client_cert'] =
‘/etc/certs/ssl.crt/server_cert.crt’
soap.options[‘protocol.http.ssl_config.client_key’]=’/etc/certs/ssl.crt/server_key_nopass.pem’
soap.options[‘protocol.http.ssl_config.ca_file’]=’/etc/certs/ssl.crt/ca.crt’
dn = soap.getDn(user)
end
end