11/22/2006 9:34 AM
post5677
|
Improvements to WSDLs and XSDs
I've found some issues with the current WSDL and schema definition and suggest the
corresponding modification is made. There are three kinds of issues that are concerned:
(1) in AgreementState.wsdl
<xs:complexType name="AgreementStatePropertiesType">
<xs:sequence>
<xs:element ref="wsag:AgreementState" />
<xs:element ref="wsag:GuaranteeTermStateList" />
<xs:element ref="wsag:ServiceTermStateList" />
</xs:sequence>
</xs:complexType>
should be
<xs:complexType name="AgreementStatePropertiesType">
<xs:sequence>
<xs:element ref="wsag:AgreementState" />
<xs:element ref="wsag:GuaranteeTermState"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="wsag:ServiceTermState"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
It avoids the definition of additional type wsag:GuaranteeTermStateList and wsag:ServiceTermStateList. It is more
consistent with the WSRF specification by giving individual access to each of the GuaranteeTermState and
ServiceTermState items.
Correspondingly, the current definition of wsag:GuaranteeTermStateList and wsag:ServiceTermStateList in
agreement_state_types.xsd :
<xsd:element name="GuaranteeTermStateList" type="wsag:GuaranteeTermStateListType" />
<xsd:element name="ServiceTermStateList" type="wsag:ServiceTermStateListType" />
should correspondingly be modified into
<xsd:element name="GuaranteeTermState" type="wsag:GuaranteeTermStateType" />
<xsd:element name="ServiceTermState" type="wsag:ServiceTermStateType" />
(2) Related with issue (1), I stongly suggest wsag:AgreementStateType and wsag:GuaranteeTermStateType and wsag:
ServiceTermStateType defined in the way as the attached agreement_state_types.xsd .
Take ServiceTermState for example. Briefly speaking, it defines the ServiceTermState as a global element to support
issue(1). AND, the ServiceTermStateType extends the TermStateType and the corresponding type of state is defined as an
attribute extension.
---original---
<xsd:complexType name="GuaranteeTermStateListType">
<xsd:choice maxOccurs="unbounded">
<xsd:element name="NotDetermined" type="wsag:TermStateType" />
<xsd:element name="Fulfilled" type="wsag:TermStateType" />
<xsd:element name="Violated" type="wsag:TermStateType" />
</xsd:choice>
</xsd:complexType>
---suggestion---
<xs:complexType name="GuaranteeTermStateType">
<xs:complexContent>
<xs:extension base="wsag:TermStateType">
<xs:attribute name="state">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="NotDetermined" />
<xs:enumeration value="Fulfilled" />
<xs:enumeration value="Violated" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
This also has several other practical advantages. First, if the state element has sub elements, the change of state will
result into complicated XML process or Java object operations in the old definition and with the suggested definition
you only need to change the state attribute of the corresponding element. Second, this definition is more consistent
with the style of definition in agreement_types.xsd (look at the different term type definitions there). Last, both
Globus and Axis 1.x has problem in stub generation for xsd:choice maxOccurs="unbounded".
After all, this change does not result into the loss of constraint power and do not...
View Full Message
|
|
|