Flowdock
method

any2soap

Importance_0
v1_8_7_330 - Show latest stable - 0 notes - Class: SOAP::Mapping::WSDLLiteralRegistry
any2soap(obj, qname) 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 148
  def any2soap(obj, qname)
    if obj.is_a?(SOAPElement)
      obj
    elsif obj.class.class_variables.include?('@@schema_element')
      stubobj2soap(obj, qname)
    elsif obj.is_a?(SOAP::Mapping::Object)
      mappingobj2soap(obj, qname)
    elsif obj.is_a?(Hash)
      ele = SOAPElement.from_obj(obj)
      ele.elename = qname
      ele
    else
      # expected to be a basetype or an anyType.
      # SOAPStruct, etc. is used instead of SOAPElement.
      begin
        ele = Mapping.obj2soap(obj, nil, nil, MAPPING_OPT)
        ele.elename = qname
        ele
      rescue MappingError
        ele = SOAPElement.new(qname, obj.to_s)
      end
      if obj.respond_to?(:__xmlattr)
        obj.__xmlattr.each do |key, value|
          ele.extraattr[key] = value
        end
      end
      ele
    end
  end
Register or log in to add new notes.