Forum Discussion

Ferdinand_Aliwa's avatar
Ferdinand_Aliwa
Occasional Contributor
15 years ago

About null...

Hi Guys,

I have a quick question. One of our developer stated this on the email:

QA may set empty ‘’ or ‘’ to field, but sopaUI transferred 0 to that.

So if QA want to test null message returned, they can delete the line of the field.  This method ‘’ can work for string type, but not for numeric type.


Does this statement true? Does xsi:nil="true" only works for the string? I do not think so right?

And removing the parameter from the field is the same thing with putting xsi:nil="true" as an attribute?

I do not think if we put null as attributes in integer type, does soapUI treated automatically as 0? Is that correct?

Thanks,
Ferdinand

1 Reply

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    Out of a XML Schema perspective, xsi:nil="true" is used to represent a null value, String or otherwise. This is not the same as sending an empty element (). The difference is that an element with xsi:nil has no value, whereas the empty element has an empty value. For an xsd:string type this is an empty string. Many XSD types do not allow empty values, such as xsd:int, but they can still be null if the schema allows it (by setting nillable="true").

    Regards,
    Dain
    eviware