【发布时间】:2017-10-26 21:23:21
【问题描述】:
我将 Web Service of Chronopost 与库 Zeep 一起使用。
但我无法在方法 searchDeliverySlot 上进行身份验证
wsdl = 'https://ws.chronopost.fr/rdv-cxf/services/CreneauServiceWS?wsdl'
client = zeep.Client(wsdl=wsdl)
header = xsd.Element(
'{http://cxf.soap.ws.creneau.chronopost.fr/}searchDeliverySlot',
xsd.ComplexType([
xsd.Element(
'{http://cxf.soap.ws.creneau.chronopost.fr/}accountNumber',
xsd.String()),
xsd.Element(
'{http://cxf.soap.ws.creneau.chronopost.fr/}password',
xsd.String()),
])
)
header_value = header(accountNumber='xxxxxx', password='xxxxx')
data = client.service.searchDeliverySlot(callerTool='RDVWS',productType='FRESH',shipperZipCode='73000',recipientZipCode='73000',dateBegin=datetime.date(2017, 10, 30),isDeliveryDate=True
, _soapheaders=[header_value]
)
我收到此错误
{
'code': 30,
'message': 'Invalid accesColis password null',
'meshCode': None,
'slotList': [],
'transactionID': None
}
你能帮我对服务进行身份验证吗
谢谢
【问题讨论】:
标签: python web-services soap soap-client zeep