Forum Discussion

Soaper's avatar
Soaper
Occasional Contributor
16 years ago

SOAPUI 3.0 PRO (trial) removes elements in XML

Hi,

Is there a way to avoid optional elements being deleted from request XML?
I have created the request with all optional elements in it.
Due to the fact that SOAPUI deletes those at random sometimes it's causing an issue with my tests. It looks like accessing the Form view is doing it, but it is not all the time. Also it happens when I run loadtests.

I'm using property transfers a.t.m. and when an optional element is deleted I can not transfer my values to those elements. If I can create those elements on the fly during a testrun with the help of a property transfer then my problem is solved to.

-- Edit ---
I think I figured out where the problem lies, but it's something I can't change I believe.
It happens when an element in a request xml is send as empty -->
When such an element is in the request and you change to Form view then it will be removed from the XML.

-- .Edit --

Is there an option to change this or disable this?

Regards,
Robin
  • Hi Robin,

    You could try checking "Include Optional" in Preferences/WSDL Settings and
    see if that helps...

    Regards,

    /Dragica
    eviware.com
  • Soaper's avatar
    Soaper
    Occasional Contributor
    Hi Dragica,

    Thank you for your answer, but unfortunately this option was already checked and still the Form removes these elements from my XML view.

    I have found a work around though by filling these optional elements with dummy values. Though not best option it works for me.

    If you have any other option that might help then that would be much appreciated.

    Regards,
    Robin
  • Hi Robin,

    problem is (as you have noted) that the Form editor removed empty optional content.. one possible workaround would be to use some kind of "LEAVEEMPTY" content and create an EventHandler that removes this (but not the element) on the request.. Is that an option?

    regards!

    /Ole
    eviware.com
  • Soaper's avatar
    Soaper
    Occasional Contributor
    Hi Ole,

    I will try to create an eventhandler for it. Will read up on those in SOAPUI since I haven't used those yet.

    Thank you for the response.

    Regards,
    Robin