Flowdock
method

complexobj2soap

Importance_0
v1_8_7_330 - Show latest stable - 0 notes - Class: SOAP::Mapping::WSDLLiteralRegistry
complexobj2soap(obj, type, qualified) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/soap/mapping/wsdlliteralregistry.rb, line 119
  def complexobj2soap(obj, type, qualified)
    o = SOAPElement.new(type.name)
    o.qualified = qualified
    type.each_element do |child_ele|
      child = Mapping.get_attribute(obj, child_ele.name.name)
      if child.nil?
        if child_ele.nillable
          # ToDo: test
          # add empty element
          child_soap = obj2elesoap(nil, child_ele)
          o.add(child_soap)
        elsif Integer(child_ele.minoccurs) == 0
          # nothing to do
        else
          raise MappingError.new("nil not allowed: #{child_ele.name.name}")
        end
      elsif child_ele.map_as_array?
        child.each do |item|
          child_soap = obj2elesoap(item, child_ele)
          o.add(child_soap)
        end
      else
        child_soap = obj2elesoap(child, child_ele)
        o.add(child_soap)
      end
    end
    o
  end
Register or log in to add new notes.