method
any2soap
ruby latest stable - Class:
SOAP::Mapping::WSDLLiteralRegistry
any2soap(obj, qname)private
No documentation available.
# 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