I Want to Pass null value from Soap UI for Datetime Field one option is that i should delete the tag . There is any other way where i can pass null or some other value in date field.
<rt6:DateofBirth></rt6:DateofBirth>
Question: how to pass a NULL value in a SOAP envelope? Answer: Use the xsi:nil=”true” attribute on the element, and don't forget the xsi namespace in the envelope.
Is it possible to set datetime object to null in C#? DateTime is a Value Type like int, double etc. so there is no way to assigned a null value.
<rt6:DateofBirth></rt6:DateofBirth>
is not null, but empty String (not in all languages this is the same), use xsi:nil="true"
, so
<rt6:DateofBirth xsi:nil="true" />
where xsi namespace is xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
.
General answer:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Add this to namespaces on root tag. Then add this property to tag
xsi:nil="true"
E.g:
<vp1:DateofBirth xsi:nil="true"></vp1:DateofBirth>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With