Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1096

Show
Ignore:
Timestamp:
12/02/03 16:23:13 (5 years ago)
Author:
nahi
Message:

* recover environment variable proxy setting feature. you can specify http

proxy with env http_proxy(ignore case), and unproxyed list with env
no_proxy(dittto). but bear in mind that these environment are only valid if
env soap_use_proxy is turned 'on'. so you must specify http_proxy like;

bash> soap_use_proxy=on http_proxy=http://myproxy:8080 ruby myclient.rb
csh > env soap_use_proxy=on http_proxy=http://myproxy:8080 ruby myclient.rb

environment variables are checked only once when soap/soap.rb is loaded.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/soap/rpc/driver.rb

    r1089 r1096  
    8383    @servant.soapaction = soapaction 
    8484    @proxy = @servant.proxy 
     85    if env_httpproxy = ::SOAP::Env::HTTP_PROXY 
     86      @servant.options["client.protocol.http.proxy"] = env_httpproxy 
     87    end 
     88    if env_no_proxy = ::SOAP::Env::NO_PROXY 
     89      @servant.options["client.protocol.http.no_proxy"] = env_no_proxy 
     90    end 
    8591  end 
    8692 
  • trunk/lib/soap/soap.rb

    r1058 r1096  
    1414 
    1515 
    16 Version = '1.5.1
     16Version = '1.5.2
    1717 
    1818EnvelopeNamespace = 'http://schemas.xmlsoap.org/soap/envelope/' 
     
    9191  def to_s 
    9292    str = nil 
    93     if @faultstring && @faultstring.respond_to?('data') 
     93    if @faultstring and @faultstring.respond_to?('data') 
    9494      str = @faultstring.data 
    9595    end 
     
    9898end 
    9999 
     100module Env 
     101  def self.getenv(name) 
     102    ENV[name.downcase] || ENV[name] 
     103  end 
     104 
     105  use_proxy = getenv('soap_use_proxy') == 'on' 
     106  HTTP_PROXY = use_proxy ? getenv('http_proxy') : nil 
     107  NO_PROXY = use_proxy ? getenv('no_proxy') : nil 
     108end 
     109 
    100110 
    101111end 
  • trunk/lib/soap/wsdlDriver.rb

    r1089 r1096  
    133133  def initialize(wsdl, port, logdev) 
    134134    @servant = Servant__.new(self, wsdl, port, logdev) 
     135    if env_httpproxy = ::SOAP::Env::HTTP_PROXY 
     136      @servant.options["client.protocol.http.proxy"] = env_httpproxy 
     137    end 
     138    if env_httpproxy = ::SOAP::Env::NO_PROXY 
     139      @servant.options["client.protocol.http.no_proxy"] = env_httpproxy 
     140    end 
    135141  end 
    136142 
  • trunk/lib/wsdl/importer.rb

    r1058 r1096  
    99require 'wsdl/info' 
    1010require 'wsdl/parser' 
     11require 'soap/soap' 
    1112 
    1213 
     
    2829      content = File.open(location).read 
    2930    else 
    30       proxy = ENV['http_proxy'] || ENV['HTTP_PROXY'] 
    31       content = web_client.new(proxy, "WSDL4R").get_content(location) 
     31      client = web_client.new(nil, "WSDL4R") 
     32      if env_httpproxy = ::SOAP::Env::HTTP_PROXY 
     33        client.proxy = env_httpproxy 
     34      end 
     35      if env_no_proxy = ::SOAP::Env::NO_PROXY 
     36        client.no_proxy = env_no_proxy 
     37      end 
     38      content = client.get_content(location) 
    3239    end 
    3340    opt = {}    # charset?