Discussion Forums
- Topic List
- Most Recent Posts
- Sign In for more options
Hello,
I am facing problem during accessing web service beyond proxy. I am successfully able access the same web service without proxy. Please suggest how to set proxy object while calling the web service.
here is code that i am using for calling soap based web service.
factory = SOAP::WSDLDriverFactory.new() soap = factory.create_rpc_driver
For time being I overwrite net/http method in my application itself. I write following snippet of code in my environment.rb file. It solved my problem.
require 'net/protocol'
module Net class HTTP < Protocol
def HTTP.new(address, port = nil, p_addr = "", p_port = , p_user = "", p_pass = "")
h = Proxy(p_addr, p_port, p_user, p_pass).newobj(address, port)
h.instance_eval {
@newimpl = ::Net::HTTP.version_1_2?
}
h
end
end end
you can also write this code in lib file and require that file in to your code when required
can you try using environment variable to set proxy?
ENV['http_proxy'] = "http://mysekret.proxy,com"
factory = SOAP::WSDLDriverFactory.new() soap = factory.create_rpc_driver
