method
create_connection
ruby latest stable - Class:
SOAP
create_connection(url)private
No documentation available.
# File lib/soap/netHttpClient.rb, line 123
def create_connection(url)
proxy_host = proxy_port = nil
unless no_proxy?(url)
proxy_host = @proxy.host
proxy_port = @proxy.port
end
http = Net::HTTP::Proxy(proxy_host, proxy_port).new(url.host, url.port)
if http.respond_to?(:set_debug_output)
http.set_debug_output(@debug_dev)
end
http.open_timeout = @connect_timeout if @connect_timeout
http.read_timeout = @receive_timeout if @receive_timeout
case url
when URI::HTTPS
if SSLEnabled
http.use_ssl = true
else
raise RuntimeError.new("Cannot connect to #{url} (OpenSSL is not installed.)")
end
when URI::HTTP
# OK
else
raise RuntimeError.new("Cannot connect to #{url} (Not HTTP.)")
end
http
end