I receive xml from a third party webservice which is validated by Vast against an xsd supplied by the same third party.
Sometimes the xml is rejected by vast because it fails the validation. I get the message
Content '''' does not conform to facet (length = 12)
This message is generated by the method validate: in AbtXmlSchemaRestriction.
The xsd states a length of 12 for the element, but the element contains an empty string.
That explains the generated exception, but the xsd also states that the element can be nil.
My question is: Should Vast in this case handle an empty string the same as nil or is the xsd incorrect?
The snippet of xml as parsed by AbtXmlMappingParser:
- Code: Select all
<audp:vgs-codes><audp:vgs-code xsi:nil="true"/></audp:vgs-codes>
The snippet of xsd :
- Code: Select all
<xsd:complexType name="uitvoeringsinfo">
<xsd:sequence>
<xsd:element name="vgs-codes" type="vgs-codes" nillable="true"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="vgs-codes">
<xsd:sequence>
<xsd:element name="vgs-code" type="vgs-code" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="vgs-code">
<xsd:restriction base="xsd:string">
<xsd:length value="12"/>
</xsd:restriction>
</xsd:simpleType>
Greetz, Ben