我已经用以下方法隔离了我的代码,并且仍然得到了这个错误:“TYPE_MESSAGE的预期规则,但得到了TYPE_ENUM”,在ValidateAppDataAndGeneratePDFReply,VerificationResult上。
<xs:complexType name="VerificationResultType">
<xs:sequence>
<xs:element name="VerificationPassed" type="xs:boolean"/>
<xs:element name="FunctionalError" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="ErrorPointer" type="xs:string"/>
<xs:element name="ErrorType" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ValidateApplicationDataReply">
<xs:sequence>
<xs:element name="ApplicationVerificationResult" type="this:VerificationResultType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ValidateAppDataAndGeneratePDFReply">
<xs:sequence>
<xs:element name="VerificationResult" type="this:VerificationResultType"/>
<xs:element name="Url" type="xs:string"/>
</xs:sequence>
</xs:complexType>我尝试重新排序VerificationResultType或注释掉一个一个地使用它的complexTypes。但问题依然存在。
Pom.xml依赖关系:
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.12.0</version>
</dependency>
</dependencies>原版2
发布于 2022-03-01 09:42:21
在另一个文件上有一个枚举,在这个文件中我没有使用,并且与名称混淆了。
<xs:simpleType name="ResultType">
<xs:restriction base="xs:string">
<xs:enumeration value="CREATED"/>
<xs:enumeration value="UPDATED"/>
<xs:enumeration value="DELETED"/>
<xs:enumeration value="ERROR"/>
</xs:restriction>
</xs:simpleType>不知何故,VerificationResultType.和ResultType混淆了
原型
我对此没有任何解释。任何对XSD有更深入了解的人都会回答.
https://stackoverflow.com/questions/71297996
复制相似问题