Flowdock
method

register_type

Importance_0
v1.2.6 - Show latest stable - 0 notes - Class: ActionWebService::Protocol::Soap::SoapMarshaler
register_type(type) public

No documentation

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

Hide source
# File actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb, line 40
        def register_type(type)
          return @type2binding[type] if @type2binding.has_key?(type)

          if type.array?
            array_mapping = @registry.find_mapped_soap_class(Array)
            qname = XSD::QName.new(@namespace, soap_type_name(type.element_type.type_class.name) + 'Array')
            element_type_binding = register_type(type.element_type)
            @type2binding[type] = SoapBinding.new(self, qname, type, array_mapping, element_type_binding)
          elsif (mapping = @registry.find_mapped_soap_class(type.type_class) rescue nil)
            qname = mapping[2] ? mapping[2][:type] : nil
            qname ||= soap_base_type_name(mapping[0])
            @type2binding[type] = SoapBinding.new(self, qname, type, mapping)
          else
            qname = XSD::QName.new(@namespace, soap_type_name(type.type_class.name))
            @registry.add(type.type_class,
              SOAP::SOAPStruct,
              typed_struct_factory(type.type_class),
              { :type => qname })
            mapping = @registry.find_mapped_soap_class(type.type_class)
            @type2binding[type] = SoapBinding.new(self, qname, type, mapping)
          end

          if type.structured?
            type.each_member do |m_name, m_type|
              register_type(m_type)
            end
          end
          
          @type2binding[type]
        end
Register or log in to add new notes.