Allow null constraint in document type

Hi All,

I have a schema imported where for one of the field “ProjectType” Required is “true” and allow null is “false”.

When I’m posting the xml from soapui as below
a ---- > schema validation is “true” . Which is expected

But if I pass as (empty tag) -----> schema validation is true. This should have failed validation as constraint “allow null” is false.

Please advice on this.

Hi Monica,

the empty tag does not represent a null value, but just an object of length=0.

would be rendered as a null value.

If you require the empty tag (without xsi:nil-attribute) to fail validation, add a minLength=“1” to the fields restrictions in the xsd.
Then validation will fail with “… is shorter than minimum length”.