xmlxsdschemamendix

XSD getting error: 'Any' element not supported


I am importing an xsd into Mendix to setup a Web Service that will import a XML file that will have an embedded pdf file in it. When I try to add the XSD to Mendix it gives me an error

Type of element 'http://tempuri.org/CREDIT_RESPONSE_v2_3_1:DOCUMENT': 'Any' element is not supported.

I searched the Mendix forums and they say if you want to add support for this xsd you will have to determine what kind of responses you expect and change the xsd accordingly.

<xs:element name="DOCUMENT">
    <xs:complexType mixed="false">
        <xs:sequence>
            <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##any"/> <!-- Error on any --> 
        </xs:sequence>
    </xs:complexType>
</xs:element>
<xs:element name="EMBEDDED_FILE">
    <xs:complexType>
        <xs:sequence>
            <xs:element ref="DOCUMENT" />
        </xs:sequence>
        <xs:attribute name="_ID" type="xs:ID" />
        <xs:attribute name="_Type" type="xs:string" />
        <xs:attribute name="_Version" type="xs:string" />
        <xs:attribute name="_Name" type="xs:string" />
        <xs:attribute name="_Extension" type="xs:string" />
        <xs:attribute name="_EncodingType" type="xs:string" />
        <xs:attribute name="_Description" type="xs:string" />
        <xs:attribute name="MIMEType" type="xs:string" />
    </xs:complexType>
</xs:element>

My question is how do I find out what type of responses are valid for the any parameter?


Solution

  • From the Mendix Reference Guide 6:

    XML Schema Support

    When you import an XML schema (.xsd file) or web service definition (.wsdl file) using the Mendix Business Modeler, you might get a dialog that contains warning messages about unsupported constructs. This is because currently Mendix does not support the entire XSD standard. The mapping in Mendix is based on entities and attributes, and some XSD constructs do not lend themselves easily for this format. The following table shows which XSD constructs are supported in Mendix.

    The table goes on to say that xsd:any is not supported.

    Therefore, if you want to use their tool, you cannot use xsd:any.

    My question is how do I find out what type of responses are valid for the any parameter?

    By definition, any XML can go there; that's the point of xsd:any. (See details about how to use xsd:any/@processContents) In order to limit the XML that can go there and be able to use the Mendix Business Modeler, you'll have to define the XML in terms of the limited set of XSD features that Mendix supports.

    If you do not control DOCUMENT contents, then you'll have to consult with the authority that does. Hint: I've seen CREDIT_RESPONSE_v2_3_1 used in MISMO (Mortgage Industry Standards Maintenance Organization) XML.