Python ChronoFresh SOAP auth
我正在用图书馆的电脑 但我无法在方法searchDeliverySlot上进行身份验证Python ChronoFresh SOAP auth,python,web-services,soap,soap-client,zeep,Python,Web Services,Soap,Soap Client,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/}searchDelivery
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
}
你能帮我认证服务吗
谢谢是的,我找到了正确的语法。要做到这一点,我需要帮助我使用SOAP UI,它显示要发送的正确xml对象
header = xsd.Element(
'{http://schemas.xmlsoap.org/soap/envelope/}Header',
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()),
])
)