【问题标题】:Python Spyne custom output parametersPython Spyne 自定义输出参数
【发布时间】:2016-06-22 01:33:22
【问题描述】:

我在 Spyne 中需要这样的输出:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <getActiveServicesResponse xmlns="http://mci.tajmi.ir/">
            <getActiveServicesReturn>12345:2030:hafez poem:hafez </getActiveServicesReturn>
            <getActiveServicesReturn>12346:2031:شعر طنز:tanz </getActiveServicesReturn>
            <getActiveServicesReturn>bardari123:203861:سرویس بارداري :bar
</getActiveServicesReturn>
        </getActiveServicesResponse>
    </soapenv:Body>
</soapenv:Envelope>

我能生成的是

<?xml version='1.0' encoding='UTF-8'?>
<soap11env:Envelope xmlns:soap11env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://mci.tajmi.ir/">
    <soap11env:Body>
        <tns:getActiveServicesResponse>
            <tns:getActiveServicesReturn>
                <tns:string>12345:2030:hafez poem:hafez</tns:string>
                <tns:string>12346:2031:شعر طنز:tanz </tns:string>
                ....
            </tns:getActiveServicesReturn>
        </tns:getActiveServicesResponse>
    </soap11env:Body>
</soap11env:Envelope>

如何自定义输出?我尝试了复杂的方法但没有成功。

【问题讨论】:

  • 请同时添加您的 spyne 代码

标签: python soap spyne


【解决方案1】:

看看我的代码https://github.com/timi-ro/simulator。你可以找到如何制作它。另请阅读: Spyne - how to duplicate one elements of wsdl file created by spyne?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-10
    • 1970-01-01
    • 1970-01-01
    • 2021-03-04
    • 1970-01-01
    相关资源
    最近更新 更多