Flowdock
method

register_type

Importance_0
v1.0.0 - 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 38
        def register_type(type)
          return @type2binding[type] if @type2binding.has_key?(type)

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

          array_binding = nil
          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')
            array_binding = SoapBinding.new(self, qname, type, array_mapping, type_binding)
          end

          @type2binding[type] = array_binding ? array_binding : type_binding
          @type2binding[type]
        end
Register or log in to add new notes.