我正在设置一个 Ladon SOAP 服务器,但根本无法让它返回列表。
这是我所拥有的:
class V1(object):
"""
This service returns events between two times for a given trackable.
"""
@ladonize(rtype=[ PORTABLE_STRING ])
def getGroupNames(self):
"""
Returns a list of group names.
@rtype: List of group names.
"""
cnn = db.get_connection()
sql = "blah blah sql"
params = {}
groups = db.execute_fetchall(cnn, sql, params)
ret = []
for g in groups:
ret += [g["group_description"]]
return ret
我得到的错误是:
WebFault: Server raised fault: 'Return-type mismatch in V1::getGroupNames: Expected [<type 'unicode'>] recieved <type 'list'>'
它需要一个 unicode 列表,而我正在返回一个 unicode 列表,但它坚持认为它们不是一回事。
我错过了什么?