Class: SOAP::Mapping::ArrayFactory_

Class | SOAP::Mapping::ArrayFactory_
In: | soap/mapping/factory.rb
Parent: | Factory

### Methods

new obj2soap soap2obj

### Public Class methods

new(allow_original_mapping = false)

[Source]

    # File soap/mapping/factory.rb, line 206
      def initialize(allow_original_mapping = false)
        super()
        @allow_original_mapping = allow_original_mapping
      end

### Public Instance methods

obj2soap(soap_class, obj, info, map)

[1], [2]
  is converted to Array of Array, not 2-D Array.

To create M-D Array, you must call Mapping.ary2md.

[Source]

    # File soap/mapping/factory.rb, line 213
      def obj2soap(soap_class, obj, info, map)
        if !@allow_original_mapping and !obj.instance_variables.empty?
          return nil
        end
        arytype = Mapping.obj2element(obj)
        if arytype.name
          arytype.namespace ||= RubyTypeNamespace
        else
          arytype = XSD::AnyTypeName
        end
        soap_obj = SOAPArray.new(ValueArrayName, 1, arytype)
        mark_marshalled_obj(obj, soap_obj)
        obj.each do |item|
          soap_obj.add(Mapping._obj2soap(item, map))
        end
        soap_obj
      end

soap2obj(obj_class, node, info, map)

[Source]

    # File soap/mapping/factory.rb, line 231
      def soap2obj(obj_class, node, info, map)
        obj = Mapping.create_empty_object(obj_class)
        mark_unmarshalled_obj(node, obj)
        node.soap2array(obj) do |elem|
          elem ? Mapping._soap2obj(elem, map) : nil
        end
        return true, obj
      end

[Validate]