How to send null values in soapUI requests
soapUI is a pretty useful web service testing tool that can help you generate a multitude of tests like load testing, functional testing, data consistency testing and many more. I have started using it for real two days ago when I needed to test some SOAP web services for work. The main issue that kept me from being more productive with this test platform was that nowhere in its documentation one can find how to send null values in a request.
In the soapUI User Guide, in the “Working with Web Service Request” there is a tricky property called Remove Empty Content.
Remove Empty Content : Removes empty elements/attributes from outgoing requests. This can be useful in Data Drive TestRequests which contain elements/attributes that not always contain data and should be removed in those cases.
What I understand from this property is that if I have an empty field that I would like not to be transmitted further into my request, setting this property to true, the field will be marked as null and transmitted like that. Well, the result isn’t the one you would have expected. Doing like that will only bring you more and more frustrations as the only thing you will obtain will be a beautifully crafted server error complaining that some fields don’t have proper values (the errors are more technical like “invalid date format or argument“, “value expected for … field“).
So, answering the question “How to send null data in a request with soapUI?“, the thing that you should do is to mark the respective field like this:
<ns :field xmlns:field="http://www.w3.org/2001/XMLSchema-instance" field:nil="true" />
or, assuming that you do not want to write this kind of attributes for many empty fields in a request, something like this:
<?xml version="1.0" encoding="utf-8"?>
<soap :Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soapbody>
<parenttag>
<childtag1>value</childtag1>
<childtag2 xsi:nil="true" />
<childtag2 xsi:nil="true" />
</parenttag>
</soapbody>
</soap>
Enjoy!
Similar Posts:
- Resolving vertically flipped images from webcams in Ubuntu
- Securing WordPress from the ground up
- Google Desktop, Google Chrome and Google Gadgets in Ubuntu
- How to install Ubuntu Desktop Edition
- Oracle TopLink, the ORA-00900 error and stored procedures
1 Comment
Leave a comment
Secure your files
Recent Posts
Recent Comments
Radu said:
After you install VMware Server there is no menu entry for it. To access its interface you should open a browser tab and go to... more»
Radu said:
I bought mine just a month before they launched the 3rd generation. But it’s really okay for my needs. more»
Radu said:
Something must have gone wrong during the install process. Try to reinstall the drivers (after you have uninstalled them previously)... more»
Radu said:
I think you should start Firefox (due to the fact that the plugin runs under it) with that custom wrapper script. more»
RGG said:
As with Mai I removed vmnet, vmci and vmmon. Ran sudo vmware-config.pl and it reran the last part of the install but did not add any... more»
Recent Tweets
- jQuery .click() and the double submit of a form - http://bit.ly/dcCGqR [#]







Thank you for your post I really liked it:)
We will link to your blog from our website