Prefixing it with types does work:
<simpleType name="ErrorCodes">
<restriction base="xsd:QName">
<enumeration value="types:AccessDenied"/>
<enumeration value="types:ExportNoLongerValid"/>
<enumeration value="types:InconsistentParameters"/>
<enumeration value="types:InvalidRegistration"/>
<enumeration value="types:InvalidCookie"/>
<enumeration value="types:InvalidHandle"/>
<enumeration value="types:InvalidSession"/>
<enumeration value="types:InvalidUserCategory"/>
<enumeration value="types:ModifyRegistrationRequired"/>
<enumeration value="types:MissingParameters"/>
<enumeration value="types:OperationFailed"/>
<enumeration value="types:OperationNotSupported"/>
<enumeration value="types:ResourceSuspended"/>
<enumeration value="types:TooBusy"/>
<enumeration value="types:TooManyRequests"/>
</restriction>
</simpleType>
Also, I have found several bugs with Axis1 (1.2,1, 1.3, and 1.4) with
enumerated QNames.
Nate
Rich Thompson wrote:
Have you tried prefixing the values
with "types:" to see if an appropriate runtime message is generated?
It looks to me like the Axis stack would generate a value of
"types:AccessDenied",
but I don't know what it would place into the message as namespace
declarations.
Another possibility is that we need
to declare a type which extends xsd:QName such that the enumeration can
be against that type and therefore in the WSRP types namespace. I would
definitely want enough testing to know exactly what solution is
actually
needed.
Rich
This turned out be a little more subtle than I
originally
thought.
Here are some messages worth validating. We tried JAXP based
validation,
and also on online validator at http://www.xmlforasp.net/SchemaValidator.aspx.
Message 1:
<v2:destroyPortletsResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:v2="urn:oasis:names:tc:wsrp:v2:types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:wsrp:v2:types
wsrp-2.0-types.xsd">
<v2:failedPortlets errorCode="v2:AccessDenied">
<v2:portletHandles>test</v2:portletHandles>
</v2:failedPortlets>
</v2:destroyPortletsResponse>
This does not validate against the v2 types schema. JAXP reports the
following:
3,48 cvc-enumeration-valid: Value 'InvalidHandle' is not facet-valid
with
respect to enumeration '[AccessDenied, ExportNoLongerValid,
InconsistentParameters,
InvalidRegistration, InvalidCookie, InvalidHandle, InvalidSession,
InvalidUserCategory,
ModifyRegistrationRequired, MissingParameters, OperationFailed,
OperationNotSupported,
ResourceSuspended, TooBusy, TooManyRequests]'. It must be a value from
the enumeration.
3,48 cvc-attribute.3: The value 'InvalidHandle' of attribute
'errorCode'
on element 'v2:failedPortlets' is not valid with respect to its type,
'ErrorCodes'.
Message 2:
<v2:destroyPortletsResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:v2="urn:oasis:names:tc:wsrp:v2:types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:tc:wsrp:v2:types
wsrp-2.0-types.xsd">
<v2:failedPortlets errorCode="xsd:AccessDenied">
<v2:portletHandles>test</v2:portletHandles>
</v2:failedPortlets>
</v2:destroyPortletsResponse>
This message is valid against the schema.
The difference is that the second message uses errorCode from the XML
schema
namespace. Since wsrp_v2_types.xsd did not declare a prefix for the
values
of the enumeration, and since wsrp_v2_types.xsd has the attribute xmlns="http://www.w3.org/2001/XMLSchema",
the validator interpreted the enumeration values to be from the XML
schema
namespace.
6.1.25 clearly states that the faut codes uses an enum of values with
the
prefix mapped to V2 namespace URI - but wsrp_v2_types.xsd does not
reflect
this. If the schema is changed to declare the values of enumerations
from
the v2 namespace (i.e. prefix the values as "types:AccessDenied"
and so on), the first message will be valid.
Subbu
Rich Thompson wrote:
Why should it have used the fault element names? These are error codes,
not faults. I would also note that the schema matches 6.1.25 in the
spec.
Rich
We came across an error in the schema regarding the ErrorCodes type.
This type is a restriction based on QName, but it uses element names in
stead of types in the enumeration.
This type should have been
<simpleType name="ErrorCodes">
<restriction base="xsd:QName">
<enumeration value="AccessDeniedFault"/>
<enumeration value="ExportNoLongerValidFault"/>
<enumeration value="InconsistentParametersFault"/>
<enumeration value="InvalidRegistrationFault"/>
<enumeration value="InvalidCookieFault"/>
<enumeration value="InvalidHandleFault"/>
<enumeration value="InvalidSessionFault"/>
<enumeration value="InvalidUserCategoryFault"/>
<enumeration value="ModifyRegistrationRequiredFault"/>
<enumeration value="MissingParametersFault"/>
<enumeration value="OperationFailedFault"/>
<enumeration value="OperationNotSupportedFault"/>
<enumeration value="ResourceSuspendedFault"/>
<enumeration value="TooBusyFault"/>
<enumeration value="TooManyRequestsFault"/>
</restriction>
</simpleType>
This needs to be fixed.
Subbu
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries
and affiliated
entities, that may be confidential, proprietary, copyrighted
and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries
and affiliated
entities, that may be confidential, proprietary, copyrighted
and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
_______________________________________________________________________
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
|