Python Zeep缺少任何元素

2024-10-01 02:33:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我有下面的python代码,用于使用Zeep使用WS。在

date_ = date.today().strftime('%d-%m-%y %H:%M')  # '2016-08-01 00:00:00'
destination = {'column': 'destination', 'value': destination, 'type': 'string'}
doc_date = {'column': 'doc_date', 'value': date_, 'type': 'string'}
type_id = {'column': 'type_id', 'value': type_id, 'type': 'string'}  # 507
typist = {'column': 'typist', 'value': typist, 'type': 'string'}
priority = {'column': 'priority', 'value': priority, 'type': 'integer'}
data = {'datas': [destination, doc_date, type_id, typist, priority]}

try:
    res = client.service.storeResource(encoded_data, data, collID, table, fileFormat, status)

    if res.returnCode == 0:
        if category == '':
            return True
        mlb_data = {'datas': [{'column': 'category_id', 'value': category, 'type': 'string'}]}
        res2 = client.service.storeExtResource(res.resId, mlb_data, 'mlb_coll_ext')
        return True
    else:
        print("res KO")
        return False
except Exception as e:
    print("SD2:", e)
    return False

我使用soapui单独测试WS“storeResource”,并且它使用相同的参数工作。下面是运行python脚本后出现的错误

^{pr2}$

Tags: iddatadatestringdocreturnvaluetype