Forum Discussion

Ferdinand_Aliwa's avatar
Ferdinand_Aliwa
Occasional Contributor
15 years ago

can null passed as a value not as attribute?

Hi guys,

I am trying to pass a null as a value e.g. xsi:nil, instead doing it this way .
Is there any possible way to do it? Unfortunately removing(not including) the parameter on the request is also not an option....

This is for data driven testing.

Thanks in advance for the help

Ferdinand

3 Replies

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

    The correct way to pass a null value is to use or . The schema for the type should specify that it is allowed to have a null value, with the attribute nillable="true".

    If you wish some other value to be interpreted as null, then this is something your server needs to do. SoapUI should be able to send any value you specify.

    Regards,
    Dain
    eviware.com
  • amnag's avatar
    amnag
    Occasional Contributor
    Hi,

      I am using the form view in SoapUi Pro3.01. I also need to pass on a NULL value. You mentioned what needs to be done to pass on a NULL value. It helps me a lot. But unfortunately, I am a tester and not an XML guy. So could you or someone please tell the sequence of the steps that needs to be performed? Like where this statement needs to be added and how can it be done by still using the form view?

    I really appreciate it.

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

    If the element is nillable in the schema (has nillable="true") then leaving the value empty in the Form editor should produce a correct null value (xsi:nil="true"). However, this also requires the element not to be optional, else soapUI will remove it instead. If you require an element to be both optional and nillable and want to send a null value, then you would have to write an event handler. There is an example of doing something similar to this here under "Using an Event Handler".

    Regards,
    Dain
    eviware.com