【问题标题】:How to set minOccurs="0" or nillable="true" to wsdl element by using of python module with name "pysimplesoap"如何使用名为“pysimplesoap”的python模块将minOccurs="0"或nillable="true"设置为wsdl元素
【发布时间】:2014-03-25 12:33:04
【问题描述】:

我们使用 pysimplesoap 模块来编写服务。客户端是用 Java 编写的。将 xml 数据类型转换为 java 存在问题。我想,我们需要将 minOccurs="0" 或 nillable="true" 设置为 wsdl 元素。但是在名称为 server.py 的 pysimplesoap 文件中,仅对数组进行了此类转换。是否有可能做到没有kludges以及如何做到这一点?

【问题讨论】:

    标签: java python wsdl pysimplesoap


    【解决方案1】:

    像往常一样配置调度程序:

    dispatcher.register_function('test_function', test,
    returns={'Success': str}, 
    args={'wanted': str,'optional': str,'another_optional':str })
    

    定义方法时,用默认值标记可选字段:

    def test_request(wanted, optional=None, another_optional="Optional"):
    return "Success"
    

    【讨论】:

    • 我们发现,可以只为数组设置 minOccurs。但无论如何,问题已经结束了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-04-27
    • 2013-01-24
    • 1970-01-01
    • 2022-01-09
    • 1970-01-01
    • 1970-01-01
    • 2012-11-30
    相关资源
    最近更新 更多