Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Ticket #485 (new defect)

Opened 5 months ago

Last modified 5 months ago

Handling anyType and unsucessfully mapped types (e.g. unions)

Reported by: user Assigned to: nahi
Priority: highest Milestone: undefined
Component: soap4r Version: 1.5
Keywords: invalid type error Cc:

Description

when "xsd:any" is used in a schema, it translates to ["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]] in the MappingRegistry?.

When a soap message is sent, a element anyType occurs, that can not be exactly translated in soap/mapping/encodedregistry.rb#add_elesoap2stubobj -> soap2typedobj

same goes of all types with mapped_class == nil in registry

The fix is to add "item.mapped_class.nil?" in line 549, to ensure that every type that can not be mapped to a class ist treated as anyType.

=> result looks like

if item && !item.mapped_class.nil?

child = soap2typedobj(value, item.mapped_class)

else

# unknown element is treated as anyType. child = Mapping._soap2obj(value, self)

end

Change History

06/24/08 09:52:37 changed by user

Bad formating. Again the changes in soap/mapping/encodedregistry.rb#add_elesoap2stubobj

if item && !item.mapped_class.nil?
    child = soap2typedobj(value, item.mapped_class)
else
    # unknown element is treated as anyType.
    child = Mapping._soap2obj(value, self)
end