[Integration] Mapping boolean values

  

Hi all,

I am developing an application where we have to consume a SOAP web service. The information sent contains some boolean fields, and I came across with some mapping issues.

Some context: some boolean value mappings are not always applicable, and therefore I only want to map them into the request structure sometimes, according to the specific applicability. 

Problem: when I map a "False" value, it is not sent in the request structure. I believe this happens due to the attribute property (in the request structure) 'Send Default Value'. So, when I map a boolean as "False", and "Send Default Value" is set to "No", the field is not sent. However, if I set the "Send Default Value" to "Yes", it always sends the default value, even if I don't assign it a boolean value on the mappings.

Have you ever came across a situation like this? What do you usually do?


Please let me know if I was not clear enough.

Thanks,

Maria


Hi Maria,

Many times SOAP have extra boolean variables like <variableName>Specified.

These "Specified" fields are only generated on optional parameters that are structs. (int, datetime, decimal etc). All such variables will have additional variable generated with the name <variableName>Specified.

An optional boolean, if not passed, would still have the dafault value of false.  How do you differentiate between this and the one that was actually  passed with a value false ? The "specified" field lets you know if the optional boolean is passed or not. If the "specified" field is false, the value is not passed across. If it true, the boolean is passed.

Alternatively, you can consider using data types like bool? this will avoid generation of the "specified" fields.

Maybe the SOAP web service you try to consume provides these fields too, that you can use?

Also note the same issue arises for numerics and date datetime structures.

Regards,

Daniel

Hi Maria,

Just wondering where you able to solve your problem?

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi Maria,

Many times SOAP have extra boolean variables like <variableName>Specified.

These "Specified" fields are only generated on optional parameters that are structs. (int, datetime, decimal etc). All such variables will have additional variable generated with the name <variableName>Specified.

An optional boolean, if not passed, would still have the dafault value of false.  How do you differentiate between this and the one that was actually  passed with a value false ? The "specified" field lets you know if the optional boolean is passed or not. If the "specified" field is false, the value is not passed across. If it true, the boolean is passed.

Alternatively, you can consider using data types like bool? this will avoid generation of the "specified" fields.

Maybe the SOAP web service you try to consume provides these fields too, that you can use?

Also note the same issue arises for numerics and date datetime structures.

Regards,

Daniel

Hi,

I don't have any control on the SOAP service that is exposed. However, the boolean variables do not contain those "Specified" fields, and therefore I am not able to "inform" the contract of the mapping occurence. 

Therefore, I still have the same issue: on the integration structure, either I chose to send the default values and OutSystems always sends them (even when I do not map them), or I chose not to send the default values and OutSystems never sends them if they are mapped as False.

Does anyone know how to solve this, or is this just a common known-issue/limitation from the OutSystems platform?

Thanks,

Maria