fastbill
13 years agoContributor
Property Transfer when Source is empty
In soapUI 4.5.1, I have a Response message in which one ProductCode element looks like this:
<ProductCode description="Alpha 1">A1</ProductCode>
and another ProductCode which has no value looks like this:
<ProductCode description="Other"/>
In a Property Transfer step, I have 2 Transfers that transfer these values of ProductCode to two Properties defined in a Property Step. In my subsequent Request messages, I insert the Property value with this type of reference:
<ProductCode>$MyProperties#ProductCode1</ProductCode>
and later:
<ProductCode>$MyProperties#ProductCode2</ProductCode>
The first Property Transfer works, correctly transferring the value "A1" to the target Property, and in my subsequent Request messages I have this:
<ProductCode>A1</ProductCode>
I expected the second Transfer to transfer an empty value to the target Property, and my subsequent Request to look like this:
<ProductCode></ProductCode>
However, the second Transfer transfers the ProductCode element itself (literally), and it also adds each one of the namespace declarations in my Response message into that ProductCode element. Instead of "", the resulting Property looks like this:
<ProductCode description="Other" xmlns="http://..." xmlns:ns2="http://..." xmlns:ns3="http://..." xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"/>
As a result, my subsequent Request messages fail.
In my Property Transfer, I've tried first setting, then clearing, several of the Transfer options, including:
The result is always the same.
How do I get this Property Transfer to transfer only the empty value of the Source property into the Target property, so that subsequent Request messages that make reference to this property will correctly contain an empty <ProductCode></ProductCode> element?
Is this a bug in soapUI?
<ProductCode description="Alpha 1">A1</ProductCode>
and another ProductCode which has no value looks like this:
<ProductCode description="Other"/>
In a Property Transfer step, I have 2 Transfers that transfer these values of ProductCode to two Properties defined in a Property Step. In my subsequent Request messages, I insert the Property value with this type of reference:
<ProductCode>$MyProperties#ProductCode1</ProductCode>
and later:
<ProductCode>$MyProperties#ProductCode2</ProductCode>
The first Property Transfer works, correctly transferring the value "A1" to the target Property, and in my subsequent Request messages I have this:
<ProductCode>A1</ProductCode>
I expected the second Transfer to transfer an empty value to the target Property, and my subsequent Request to look like this:
<ProductCode></ProductCode>
However, the second Transfer transfers the ProductCode element itself (literally), and it also adds each one of the namespace declarations in my Response message into that ProductCode element. Instead of "", the resulting Property looks like this:
<ProductCode description="Other" xmlns="http://..." xmlns:ns2="http://..." xmlns:ns3="http://..." xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"/>
As a result, my subsequent Request messages fail.
In my Property Transfer, I've tried first setting, then clearing, several of the Transfer options, including:
- Set null on missing source
- Ignore empty/missing values
The result is always the same.
How do I get this Property Transfer to transfer only the empty value of the Source property into the Target property, so that subsequent Request messages that make reference to this property will correctly contain an empty <ProductCode></ProductCode> element?
Is this a bug in soapUI?