method
decode_tag_by_wsdl
ruby latest stable - Class:
SOAP::EncodingStyle::SOAPHandler
decode_tag_by_wsdl(ns, elename, typestr, parent, arytypestr, extraattr)private
No documentation available.
# File lib/soap/encodingstyle/soapHandler.rb, line 313
def decode_tag_by_wsdl(ns, elename, typestr, parent, arytypestr, extraattr)
o = nil
if parent.class == SOAPBody
# root element: should branch by root attribute?
if @is_first_top_ele
# Unqualified name is allowed here.
@is_first_top_ele = false
type = @decode_typemap[elename] ||
@decode_typemap.find_name(elename.name)
if type
o = SOAPStruct.new(elename)
o.definedtype = type
return o
end
end
# multi-ref element.
if typestr
typename = ns.parse(typestr)
typedef = @decode_typemap[typename]
if typedef
return decode_definedtype(elename, typename, typedef, arytypestr)
end
end
return decode_tag_by_type(ns, elename, typestr, parent, arytypestr,
extraattr)
end
if parent.type == XSD::AnyTypeName
return decode_tag_by_type(ns, elename, typestr, parent, arytypestr,
extraattr)
end
# parent.definedtype == nil means the parent is SOAPUnknown. SOAPUnknown
# is generated by decode_tag_by_type when its type is anyType.
parenttype = parent.definedtype || @decode_typemap[parent.type]
unless parenttype
return decode_tag_by_type(ns, elename, typestr, parent, arytypestr,
extraattr)
end
definedtype_name = parenttype.child_type(elename)
if definedtype_name and (klass = TypeMap[definedtype_name])
return decode_basetype(klass, elename)
elsif definedtype_name == XSD::AnyTypeName
return decode_tag_by_type(ns, elename, typestr, parent, arytypestr,
extraattr)
end
if definedtype_name
typedef = @decode_typemap[definedtype_name]
else
typedef = parenttype.child_defined_complextype(elename)
end
decode_definedtype(elename, definedtype_name, typedef, arytypestr)
end