例如,我有这些complexTypes:
<!-- will be use as a request parameter -->
<complextType name="enrollStudentRequest">
<sequence>
<element name="student" type="Student" />
</sequence>
</complexType>
<!-- will be use as an operation response -->
<complextType name="retrieveStudentsResponse">
<sequence>
<element name="student" type="Student" minOccurs="0" maxOccurs="unbounded" />
</sequence>
</complexType>
<!-- domain model -->
<complexType name="Student">
<sequence name="id" type="long" />
<sequence name="firstName" type="string" />
<sequence name="lastName" type="string" />
</complexType>
问题: 我如何强制执行以便在“enrollStudentRequest”中,Student.id是必需的但是“retrieveStudentsResponse”不需要?我可以对WSDL强制执行此类限制吗?
答案 0 :(得分:0)
不是当前形式的架构,没有。您需要重新构建WSDL /模式,或者在模式中将其保留为可选项,然后在Java中执行其他手动验证。