ChronoFresh SOAP 认证

ChronoFresh SOAP auth

我正在使用 Web Service of Chronopost with the library 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
}

你能帮我验证服务吗

谢谢

是的,我找到了正确的语法。为此,我使用 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()),
        ])
    )