Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass Null Value in DateTime Field in soap ui

Tags:

xml

soapui

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>
like image 205
Dilip Avatar asked Aug 30 '13 10:08

Dilip


People also ask

How do I send null in Soapui?

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.

Can we assign null to DateTime in C#?

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.


2 Answers

<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".

like image 195
Betlista Avatar answered Sep 20 '22 09:09

Betlista


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>
like image 29
Ali Karaca Avatar answered Sep 19 '22 09:09

Ali Karaca