(Migrated) SIO element with empty string is treated as missing

(This message has been automatically imported from the retired mailing list)

Hello,

I have a service with SIO which contains

output_required = ( …, Unicode(‘description’), …)

videos is a list of dictionaries

self.response.payload[:] = videos

if the field ‘description’ of one of the dictionaries is an empty string
I got this error:

2015-05-22 09:11:54,275 - ERROR - 27905:Dummy-252 -
zato.server.connection.http_soap.channel:22 - Caught an exception,
cid:[K04BZ72MK5TBZJ9N9C5TT2Y3QKRM], status_code:[500],
_format_exc:[Traceback (most recent call last):
File
"/home/myhome/zato-2.0.3/code/zato-server/src/zato/server/connection/http_soap/channel.py",
line 198, in dispatch
payload, worker_store, self.simple_io_config, post_data)
File
"/home/myhome/zato-2.0.3/code/zato-server/src/zato/server/connection/http_soap/channel.py",
line 351, in handle
params_priority=channel_item.params_pri)
File
"/home/myhome/zato-2.0.3/code/zato-server/src/zato/server/service/init.py",
line 414, in update_handle
response = set_response_func(service, data_format=data_format,
transport=transport, **kwargs)
File
"/home/myhome/zato-2.0.3/code/zato-server/src/zato/server/connection/http_soap/channel.py",
line 290, in _set_response_data
self.set_payload(service.response, data_format, transport, service)
File
"/home/myhome/zato-2.0.3/code/zato-server/src/zato/server/connection/http_soap/channel.py",
line 406, in set_payload
response.payload = response.payload.getvalue() if response.payload
else ''
File
"/home/myhome/zato-2.0.3/code/zato-server/src/zato/server/service/reqresp/init.py",
line 344, in getvalue
elem_value = self._getvalue(name, item, is_sa_namedtuple,
is_required, leave_as_is)
File
"/home/myhome/zato-2.0.3/code/zato-server/src/zato/server/service/reqresp/init.py",
line 290, in _getvalue
raise ZatoException(self.zato_cid, msg)
ZatoException: Expected elem:[<Unicode at 0x7f32eec31f10
name:[description]>] not found in item:[{‘description’: ‘’, ‘start_day’:
‘6’, ‘mdate’: ‘2015-05-22’, ‘name’:
‘EeFd5AA5d21aba486d93e59FcD57Dc13bFE6A7dD1’, ‘end_date’: ‘2015-05-22’,
‘start_time’: ‘1143’, ‘periodicity’: 5, ‘id’: 887868, ‘end_day’: ‘1’,
‘duration_s’: 563758, ‘caisse_id’: 123, ‘genre’: ‘P’, ‘position’:
773925, ‘group_id’: 0, ‘start_date’: ‘2060-06-12’, ‘articles_ids’:
251288, ‘end_time’: ‘0427’}]
]

This happens for other Unicode SIO fields of course.
I guess this is not normal behavior, or am I missing something?

Cheers!