'expected rules for TYPE_MESSAGE but got TYPE_ENUM

I have isolated my code with the following, and still got this error: "expected rules for TYPE_MESSAGE but got TYPE_ENUM" on 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>

I have tried to reorder the VerificationResultType or comment out the complexTypes that using it one by one. but the issue persists.

Pom.xml dependencies:

    <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>

Proto version 2



Solution 1:[1]

There was an enumeration on another file that I didn't use on this one and was confused with the name.

<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>

Somehow protobuff got confused the ResultType with VerificationResultType.

I don't have an explanation for this. Anyone with deeper knowledge on XSDs would answer.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AlexLiak