- labels: 532005 -->
- assigned_to: byrnereese --> nobody
Consider the following example:
<status xsi:type="ns:Status">completed</status>
A look into the WSDL would show that 'Status' is an
enumeration of xsd:string (or some other simple type)
values.
<simpleType name="Status">
<restriction base="xsd:string">
<enumeration value="running" />
<enumeration value="completed" />
<enumeration value="failed" />
</restriction>
</simpleType>
Looking this up may be overkill, but instead of failing
because the type 'Status' is not known, the type could
simply be treated as a simple type! So instead of:
$res = $class ?
die "Unrecognized type '$type'\n" :
$value
unless defined $res;
one could do:
$res = $value ?
$value :
die "Unrecognized type '$type'\n"
unless defined $res;
or perhaps even:
$res = $value ?
bless(\$value, $class) :
die "Unrecognized type '$type'\n"
unless defined $res;
Note that using restrictions on simple types to express
enumerations is supported out-of-the-box automatically
by other toolkits such as Axis, Glue, and even the JAXB
specification.