Forum Discussion

Buschfunk's avatar
Buschfunk
Frequent Contributor
14 years ago

Remove XML elements permanently

Hello,

I need to manipulate a request so that it is missing a complete element.

Example

Original request
<myRequest>
<element1>value1</element1>
<element2>value2</element2>
</myRequest>

Needed request
<myRequest>
<element1>value1</element1>
</myRequest>

For this, I'm switching to the XML view and delete <element2>. However when switching back to the form view the element is reinserted as an empty element <element2 />.

How can I permanently remove this element?

Sincerely,
Robert

1 Reply

  • Hi Robert,

    the Form editor will insert empty elements for content that is defined as mandatory in the underlying WSDL and its XML schema(s) - you would need to change the definition in them to be optional. An alternative might be to use the "Remove Empty Content" property of the request (in the bottom left table of properties) which removes empty elements from outgoing messages when they are being sent.

    Hope this helps,

    /Ole
    SmartBear Software