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

Changeset 1383

Show
Ignore:
Timestamp:
01/09/05 18:10:18 (4 years ago)
Author:
nahi
Message:

accept an URI object as an endpoint_url arg even under net/http environment. closes #54.

Files:

Legend:

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

    r1363 r1383  
    4444  end 
    4545   
    46   def proxy=(proxy_str
    47     if proxy_str.nil? 
     46  def proxy=(proxy
     47    if proxy.nil? 
    4848      @proxy = nil 
    4949    else 
    50       @proxy = URI.parse(proxy_str) 
     50      if proxy.is_a?(URI) 
     51        @proxy = proxy 
     52      else 
     53        @proxy = URI.parse(proxy) 
     54      end 
    5155      if @proxy.scheme == nil or @proxy.scheme.downcase != 'http' or 
    5256          @proxy.host == nil or @proxy.port == nil 
    53         raise ArgumentError.new("unsupported proxy `#{proxy_str}'") 
     57        raise ArgumentError.new("unsupported proxy `#{proxy}'") 
    5458      end 
    55       @proxy 
    5659    end 
     60    reset_all 
     61    @proxy 
    5762  end 
    5863 
     
    8085 
    8186  def post(url, req_body, header = {}) 
    82     url = URI.parse(url) 
     87    unless url.is_a?(URI) 
     88      url = URI.parse(url) 
     89    end 
    8390    extra = header.dup 
    8491    extra['User-Agent'] = @agent if @agent 
  • trunk/test/soap/test_streamhandler.rb

    r1367 r1383  
    142142  end 
    143143 
     144  def test_uri 
     145    # initialize client with URI object 
     146    @client = SOAP::RPC::Driver.new(URI.parse(@url), '') 
     147    @client.add_method("do_server_proc") 
     148    # same as test_normal 
     149    str = "" 
     150    @client.wiredump_dev = str 
     151    assert_nil(@client.do_server_proc) 
     152    r, h = parse_req_header(str) 
     153    assert_match(%r"POST / HTTP/1.", r) 
     154    assert(/^text\/xml;/ =~ h["content-type"]) 
     155  end 
     156 
    144157  def test_basic_auth 
    145158    unless Object.const_defined?('HTTPAccess2')