1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
require 'xsd/mapping'
require 'mysample.rb'
module XSD; module XSD2Ruby
module MysampleMappingRegistry
NsMysample = "urn:mysample"
Registry = ::SOAP::Mapping::LiteralRegistry.new
Registry.register(
:class => XSD::XSD2Ruby::Question,
:schema_type => XSD::QName.new(NsMysample, "question"),
:schema_element => [
["something", ["SOAP::SOAPString", XSD::QName.new(nil, "something")]]
]
)
Registry.register(
:class => XSD::XSD2Ruby::Section,
:schema_type => XSD::QName.new(NsMysample, "section"),
:schema_element => [
["sectionID", ["SOAP::SOAPInt", XSD::QName.new(nil, "sectionID")]],
["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]],
["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]],
["index", ["SOAP::SOAPInt", XSD::QName.new(nil, "index")]],
["firstQuestion", ["XSD::XSD2Ruby::Question", XSD::QName.new(nil, "firstQuestion")]]
]
)
Registry.register(
:class => XSD::XSD2Ruby::SectionArray,
:schema_type => XSD::QName.new(NsMysample, "sectionArray"),
:schema_element => [
["element", ["XSD::XSD2Ruby::Section[]", XSD::QName.new(nil, "element")], [1, nil]]
]
)
Registry.register(
:class => XSD::XSD2Ruby::SectionElement,
:schema_name => XSD::QName.new(NsMysample, "sectionElement"),
:schema_element => [
["sectionID", ["SOAP::SOAPInt", XSD::QName.new(nil, "sectionID")]],
["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]],
["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]],
["index", ["SOAP::SOAPInt", XSD::QName.new(nil, "index")]],
["firstQuestion", ["XSD::XSD2Ruby::Question", XSD::QName.new(nil, "firstQuestion")]]
]
)
end
end; end
|