【问题标题】:ChronoFresh SOAP authChronoFresh SOAP 身份验证
【发布时间】: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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多