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

Changeset 1047

Show
Ignore:
Timestamp:
11/15/03 12:52:02 (5 years ago)
Author:
nahi
Message:

add driver#mandatorycharset interface to foce using charset for parsing

response from buggy server.

Files:

Legend:

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

    r973 r1047  
    4848    @wiredump_dev = nil 
    4949    @wiredump_file_base = nil 
    50     @httpproxy = ENV['httpproxy'] || ENV['HTTP_PROXY'] 
     50    name = 'http_proxy' 
     51    @httpproxy = ENV[name] || ENV[name.upcase] 
    5152    @handler = HTTPPostStreamHandler.new(@endpoint_url, @httpproxy, 
    5253      XSD::Charset.encoding_label) 
     
    8182      @handler.reset 
    8283    end 
     84  end 
     85 
     86  def mandatorycharset 
     87    @proxy.mandatorycharset 
     88  end 
     89 
     90  def mandatorycharset=(mandatorycharset) 
     91    @proxy.mandatorycharset = mandatorycharset 
    8392  end 
    8493 
  • trunk/lib/soap/rpc/proxy.rb

    r940 r1047  
    3636 
    3737  attr_accessor :soapaction 
    38   attr_accessor :allow_unqualified_element, :default_encodingstyle 
     38  attr_accessor :mandatorycharset 
     39  attr_accessor :allow_unqualified_element 
     40  attr_accessor :default_encodingstyle 
    3941  attr_reader :method 
    4042 
     
    4345    @soapaction = soapaction 
    4446    @method = {} 
     47    @mandatorycharset = nil 
    4548    @allow_unqualified_element = false 
    4649    @default_encodingstyle = nil 
     
    105108      return nil, nil 
    106109    end 
    107     res_charset = StreamHandler.parse_media_type(data.receive_contenttype) 
    108110    opt = create_options 
    109     opt[:charset] = res_charset 
     111    opt[:charset] = @mandatorycharset || 
     112      StreamHandler.parse_media_type(data.receive_contenttype) 
    110113    res_header, res_body = Processor.unmarshal(data.receive_string, opt) 
    111114    return res_header, res_body 
  • trunk/lib/soap/wsdlDriver.rb

    r1007 r1047  
    106106  __attr_proxy :wiredump_file_base, true 
    107107  __attr_proxy :httpproxy, true 
     108  __attr_proxy :mandatorycharset, true          # force using charset 
    108109 
    109110  __attr_proxy :default_encodingstyle, true 
     
    130131    attr_reader :wiredump_file_base 
    131132    attr_reader :httpproxy 
     133    attr_accessor :mandatorycharset 
    132134 
    133135    attr_accessor :default_encodingstyle 
     
    226228      name = 'http_proxy' 
    227229      @httpproxy = ENV[name] || ENV[name.upcase] 
     230      @mandatorycharset = nil 
    228231 
    229232      @wsdl_elements = @wsdl.collect_elements 
     
    362365        return nil, nil 
    363366      end 
    364       res_charset = StreamHandler.parse_media_type(data.receive_contenttype) 
    365       opt[:charset] = res_charset 
     367      opt[:charset] = @mandatorycharset || 
     368        StreamHandler.parse_media_type(data.receive_contenttype) 
    366369      res_header, res_body = Processor.unmarshal(data.receive_string, opt) 
    367370      return res_header, res_body