AnsweredAssumed Answered

Do not send element if Null within a Raw Soap XML Request?

Question asked by KellinEHI on Jan 6, 2015
Latest reply on Jan 30, 2015 by Monika Mehta

I have a Raw SOAP request that is data driven. Within the request is all the available nodes/fields and they are all parameterized to an external data set. Is it possible for the tool to not include a node/field within the request if the parameter's value from the data set is Null.

Example:

 

Raw SOAP request:

<fin:PaymentCategoryCode>{{PaymentCategoryCode}}</fin:PaymentCategoryCode>
<fin:PaymentMediaTypeCode>{{PaymentMediaTypeCode}}</fin:PaymentMediaTypeCode>

<fin:CurrencyIsoCode>{{CurrencyIsoCode}}</fin:CurrencyIsoCode>

 

If both PaymentCategoryCode and CurrencyIsoCode have data but PaymentMediaTypeCode is Null the request looks like this:

<fin:PaymentCategoryCode>C</fin:PaymentCategoryCode>

<fin:PaymentMediaTypeCode/>

<fin:CurrencyIsoCode>USD</fin:CurrencyIsoCode>

 

But I need the request to look like this:

<fin:PaymentCategoryCode>C</fin:PaymentCategoryCode>
<fin:CurrencyIsoCode>USD</fin:CurrencyIsoCode>

 

Since PaymentMediaTypeCode is Null it is not included in the request. Is there any way to reproduce this behavior within a Raw SOAP Request? Thanks.

Outcomes