|
Revision 1858, 0.6 kB
(checked in by nahi, 2 years ago)
|
- added a sample for the new xsd2ruby.rb feature.
|
| Line | |
|---|
| 1 |
require 'xsd/mapping' |
|---|
| 2 |
require 'enumsample.rb' |
|---|
| 3 |
|
|---|
| 4 |
module EnumsampleMappingRegistry |
|---|
| 5 |
Registry = ::SOAP::Mapping::LiteralRegistry.new |
|---|
| 6 |
|
|---|
| 7 |
Registry.register( |
|---|
| 8 |
:class => HobbitType, |
|---|
| 9 |
:schema_ns => "urn:org.example.enumsample", |
|---|
| 10 |
:schema_type => "hobbit.type", |
|---|
| 11 |
:schema_qualified => false, |
|---|
| 12 |
:schema_element => [ |
|---|
| 13 |
["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]], |
|---|
| 14 |
["age", ["SOAP::SOAPInt", XSD::QName.new(nil, "age")]] |
|---|
| 15 |
] |
|---|
| 16 |
) |
|---|
| 17 |
|
|---|
| 18 |
Registry.register( |
|---|
| 19 |
:class => HobbitNameType, |
|---|
| 20 |
:schema_ns => "urn:org.example.enumsample", |
|---|
| 21 |
:schema_type => "hobbit.name.type" |
|---|
| 22 |
) |
|---|
| 23 |
end |
|---|