【问题标题】:How to specify type when using zeep使用zeep时如何指定类型
【发布时间】:2018-10-06 18:59:44
【问题描述】:

WSDL 定义一个元素如下

<xs:element minOccurs="0" name="address" nillable="true" type="q146:Address"/>

我的zeep请求如下 client.service.UpdateAddressDetails(address='sample@sample.com')

但我得到了

缺少元素类型 (UpdateAddressDetails.address.type)

据我所知,我需要指定该字段的类型。我该怎么做, 我遇到过这个 zeep documentation 但没有点击

【问题讨论】:

    标签: python django zeep


    【解决方案1】:

    您是否尝试过在地址参数中使用大写“A”:

    client.service.UpdateAddressDetails(Address='sample@sample.com')
    

    【讨论】:

      【解决方案2】:

      使用 factory = client.type_factory('q146') address = factory.Address(address='sample@sample.com') client.service.UpdateAddressDetails(address=address)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-11-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-03-28
        • 2023-03-14
        • 2012-02-29
        相关资源
        最近更新 更多