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

Changeset 1852

Show
Ignore:
Timestamp:
06/18/07 22:19:18 (1 year ago)
Author:
nahi
Message:
  • Array or Struct was not properly marshalled when literal service + generated stub combination. closes #360.
Files:

Legend:

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

    r1824 r1852  
    161161    if child_type == XSD::AnyTypeName 
    162162      type = nil 
    163     elsif child_element and (klass = element_basetype(child_element)) 
    164       type = klass.name 
     163    elsif child_element 
     164      if klass = element_basetype(child_element) 
     165        type = klass.name 
     166      else 
     167        type = create_class_name(child_element.name, @modulepath) 
     168      end 
    165169    elsif child_type 
    166170      type = create_class_name(child_type, @modulepath) 
  • trunk/test/wsdl/document/array/double.wsdl

    r1638 r1852  
    3333      </s:element> 
    3434      <s:element name="ArrayOfDouble" nillable="true" type="tns:ArrayOfDouble"/> 
     35 
     36      <s:element name="echo2"> 
     37        <s:complexType> 
     38          <s:sequence> 
     39            <s:element name="arg" type="tns:ArrayOfComplex"/> 
     40          </s:sequence> 
     41        </s:complexType> 
     42      </s:element> 
     43      <s:element name="echo2Response"> 
     44        <s:complexType> 
     45          <s:sequence> 
     46            <s:element name="arg" type="tns:ArrayOfComplex"/> 
     47          </s:sequence> 
     48        </s:complexType> 
     49      </s:element> 
     50      <s:element name="ArrayOfComplex"> 
     51        <s:complexType> 
     52          <s:sequence> 
     53            <s:element ref="tns:Complex" maxOccurs="3"/> 
     54          </s:sequence> 
     55        </s:complexType> 
     56      </s:element> 
     57      <s:element name="Complex"> 
     58        <s:complexType> 
     59          <s:sequence> 
     60            <s:element name="string" type="s:string"/> 
     61            <s:element name="double" type="s:double"/> 
     62          </s:sequence> 
     63        </s:complexType> 
     64      </s:element> 
    3565    </s:schema> 
    3666  </wsdl:types> 
     
    4272    <wsdl:part name="parameters" element="tns:echoResponse"/> 
    4373  </wsdl:message> 
     74  <wsdl:message name="echo2In"> 
     75    <wsdl:part name="parameters" element="tns:echo2"/> 
     76  </wsdl:message> 
     77  <wsdl:message name="echo2Out"> 
     78    <wsdl:part name="parameters" element="tns:echo2Response"/> 
     79  </wsdl:message> 
    4480 
    4581  <wsdl:portType name="pricerSoap"> 
     
    4783      <wsdl:input message="tns:echoIn"/> 
    4884      <wsdl:output message="tns:echoOut"/> 
     85    </wsdl:operation> 
     86 
     87    <wsdl:operation name="echo2"> 
     88      <wsdl:input message="tns:echo2In"/> 
     89      <wsdl:output message="tns:echo2Out"/> 
    4990    </wsdl:operation> 
    5091  </wsdl:portType> 
     
    5596    <wsdl:operation name="echo"> 
    5697      <soap:operation soapAction="http://tempuri.org/echo" style="document"/> 
     98      <wsdl:input> 
     99        <soap:body use="literal"/> 
     100      </wsdl:input> 
     101      <wsdl:output> 
     102        <soap:body use="literal"/> 
     103      </wsdl:output> 
     104    </wsdl:operation> 
     105    <wsdl:operation name="echo2"> 
     106      <soap:operation soapAction="http://tempuri.org/echo2" style="document"/> 
    57107      <wsdl:input> 
    58108        <soap:body use="literal"/> 
  • trunk/test/wsdl/document/array/test_array.rb

    r1794 r1852  
    2222        XSD::QName.new(Namespace, 'echoResponse') 
    2323      ) 
     24      add_document_method( 
     25        self, 
     26        Namespace + 'echo2', 
     27        'echo2', 
     28        XSD::QName.new(Namespace, 'echo2'), 
     29        XSD::QName.new(Namespace, 'echo2Response') 
     30      ) 
    2431      self.literal_mapping_registry = DoubleMappingRegistry::LiteralRegistry 
    2532    end 
    2633   
    2734    def echo(arg) 
     35      arg 
     36    end 
     37   
     38    def echo2(arg) 
    2839      arg 
    2940    end 
     
    4556      File.unlink(pathname('double.rb')) 
    4657      File.unlink(pathname('doubleMappingRegistry.rb')) 
     58      File.unlink(pathname('doubleDriver.rb')) 
    4759    end 
    4860    @client.reset_stream if @client 
     
    6274    gen.opt['classdef'] = nil 
    6375    gen.opt['mapping_registry'] = nil 
     76    gen.opt['driver'] = nil 
    6477    gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') 
    6578    gen.opt['force'] = true 
    6679    gen.run 
    67     TestUtil.require(DIR, 'doubleMappingRegistry.rb', 'double.rb') 
     80    TestUtil.require(DIR, 'doubleDriver.rb', 'doubleMappingRegistry.rb', 'double.rb') 
    6881  end 
    6982 
     
    7992 
    8093  def test_stub 
     94    @client = PricerSoap.new 
     95    @client.endpoint_url = "http://localhost:#{Port}/" 
     96    @client.wiredump_dev = STDOUT if $DEBUG 
     97    arg = ArrayOfComplex[c1 = Complex.new, c2 = Complex.new, c3 = Complex.new] 
     98    c1.string = "str_c1" 
     99    c1.double = 1.1 
     100    c2.string = "str_c2" 
     101    c2.double = 2.2 
     102    c3.string = "str_c3" 
     103    c3.double = 3.3 
     104    ret = @client.echo2(Echo2.new(arg)) 
     105    assert_equal(ArrayOfComplex, ret.arg.class) 
     106    assert_equal(Complex, ret.arg[0].class) 
     107    assert_equal(arg[0].string, ret.arg[0].string) 
     108    assert_equal(arg[1].string, ret.arg[1].string) 
     109    assert_equal(arg[2].string, ret.arg[2].string) 
     110  end 
     111 
     112  def test_wsdl_stubclassdef 
    81113    wsdl = File.join(DIR, 'double.wsdl') 
    82114    @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver