From 1ed39b739237bffd9c78e696c09462ce67017b95 Mon Sep 17 00:00:00 2001 From: nahi Date: Fri, 5 Dec 2003 13:26:26 +0000 Subject: * lib/soap/netHttpClient.rb: proxy support did not work. fixed. * lib/soap/property.rb: add class methods for loading property from stream/file/propertyfile. propertyfile is a file which is located at somedir in $:. * lib/soap/soap.rb, lib/soap/wsdlDriver.rb, lib/soap/rpc/driver.rb, lib/wsdl/importer.rb: load property from propertyfile 'soap/property' e.g. /usr/local/lib/ruby/site_ruby/1.8/soap/property. * test/soap/test_property.rb, test/soap/test_streamhandler.rb: new file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/soap/rpc/driver.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lib/soap/rpc/driver.rb') diff --git a/lib/soap/rpc/driver.rb b/lib/soap/rpc/driver.rb index e6ca3f39d3..dd433ca33f 100644 --- a/lib/soap/rpc/driver.rb +++ b/lib/soap/rpc/driver.rb @@ -82,12 +82,6 @@ class Driver @servant = Servant__.new(self, endpoint_url, namespace) @servant.soapaction = soapaction @proxy = @servant.proxy - if env_httpproxy = ::SOAP::Env::HTTP_PROXY - @servant.options["protocol.http.proxy"] = env_httpproxy - end - if env_no_proxy = ::SOAP::Env::NO_PROXY - @servant.options["protocol.http.no_proxy"] = env_no_proxy - end end def inspect @@ -144,8 +138,7 @@ private @mapping_registry = nil @soapaction = nil @wiredump_file_base = nil - @options = ::SOAP::Property.new - set_options + @options = setup_options @streamhandler = HTTPPostStreamHandler.new(endpoint_url, @options["protocol.http"] ||= ::SOAP::Property.new) @proxy = Proxy.new(@streamhandler, @soapaction) @@ -244,14 +237,21 @@ private end end - def set_options - @options.add_hook("protocol.mandatorycharset") do |key, value| + def setup_options + if opt = Property.loadproperty(::SOAP::PropertyName) + opt = opt["client"] + end + opt ||= Property.new + opt.add_hook("protocol.mandatorycharset") do |key, value| @proxy.mandatorycharset = value end - @options.add_hook("protocol.wiredump_file_base") do |key, value| + opt.add_hook("protocol.wiredump_file_base") do |key, value| @wiredump_file_base = value end - @options["protocol.http.charset"] = XSD::Charset.encoding_label + opt["protocol.http.charset"] ||= XSD::Charset.encoding_label + opt["protocol.http.proxy"] ||= Env::HTTP_PROXY + opt["protocol.http.no_proxy"] ||= Env::NO_PROXY + opt end end end -- cgit v1.2.3