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

Changeset 1893

Show
Ignore:
Timestamp:
07/21/07 12:54:01 (1 year ago)
Author:
nahi
Message:
  • check illegal constant name before const_defined? call to avoid warnings. closes #386.
Files:

Legend:

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

    r1836 r1893  
    220220  def init_param(param_def) 
    221221    param_def.each do |io_type, name, param_type| 
    222       mapped_class, nsdef, namedef = param_type 
    223       if mapped_class.is_a?(String) 
    224         mapped_class = Mapping.class_from_name(mapped_class) 
    225       end 
     222      mapped_class, nsdef, namedef = SOAPMethod.parse_param_type(param_type) 
    226223      if nsdef && namedef 
    227224        type_qname = XSD::QName.new(nsdef, namedef) 
     
    244241        end 
    245242        @retval_name = name 
    246         @retval_class_name = nil 
    247243        @retval_class_name = mapped_class 
    248244      else 
     
    250246      end 
    251247    end 
     248  end 
     249 
     250  def self.parse_param_type(param_type) 
     251    mapped_class, nsdef, namedef = param_type 
     252    # the first element of typedef in param_def can be a String like 
     253    # "::SOAP::SOAPStruct" or "CustomClass[]".  turn this String to a class if 
     254    # we can. 
     255    if mapped_class.is_a?(String) 
     256      if /\[\]\Z/ =~ mapped_class 
     257        # when '[]' is added, ignore this. 
     258        mapped_class = nil 
     259      else 
     260        mapped_class = Mapping.class_from_name(mapped_class) 
     261      end 
     262    end 
     263    [mapped_class, nsdef, namedef] 
    252264  end 
    253265end 
  • trunk/lib/soap/wsdlDriver.rb

    r1833 r1893  
    2727  def initialize(wsdl) 
    2828    @wsdl = import(wsdl) 
    29     @methoddefcreator = WSDL::SOAP::MethodDefCreator.new(@wsdl, nil
     29    @methoddefcreator = WSDL::SOAP::MethodDefCreator.new(@wsdl, nil, {}
    3030  end 
    3131   
     
    134134    # the first element of typedef in param_def is a String like 
    135135    # "::SOAP::SOAPStruct".  turn this String to a class. 
    136     param_def.collect { |io, name, typedef| 
    137       typedef[0] = Mapping.class_from_name(typedef[0]) if typedef[0] 
    138       [io, name, typedef] 
     136    param_def.collect { |io_type, name, param_type| 
     137      [io_type, name, ::SOAP::RPC::SOAPMethod.parse_param_type(param_type)] 
    139138    } 
    140139  end