首页 > 解决方案 > Spyne回归肥皂

问题描述

我在 python 和 django 中使用 spyne ......

我试图达到这样的响应:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header />
    <SOAP-ENV:Body>
        <ns5:xxx
xmlns:ns3="http://entsal.bean.domain.common.proveedorcentro.meyss.spee.es" xmlns:ns4="http://salida.bean.domain.common.proveedorcentro.meyss.spee.es" xmlns:ns5="http://impl.ws.application.proveedorcentro.meyss.spee.es">
            <ns4:a>
                <d>0</d>
                <ns3:f>
                    <e>
                        <r>20</r>
                        <y>8000000855</y>
                    </e>
                </ns3:f>
            </ns4:a>
        </ns5:xxx>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

但我得到:

<soap11env:Envelope xmlns:soap11env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://impl.ws.application.proveedorcentro.meyss.spee.es" xmlns:s0="backend.soap_sepe.spyne" xmlns:s3="http://entsal.bean.domain.common.proveedorcentro.meyss.spee.es">
    <soap11env:Body>
        <tns:xxx>
            <s3:a>
                <s3:f>
                    <s0:r>0</s0:r>
                    <s0:y>0</s0:y>
                </s3:f>
            </s3:a>
        </tns:xxx>
    </soap11env:Body>
</soap11env:Envelope>

我正在使用soap11,我不知道是否可以将soap11env 更改为SOAP-ENV,并去掉子元素上的前缀?

class f(ComplexModel):
    __type_name__ = 'f'
    __mixin__ = True

    r = Integer
    y = Integer


class a(ComplexModel):
    __type_name__ = 'a'
    __namespace__ = "http://entsal.bean.domain.common.proveedorcentro.meyss.spee.es"

    f = f


class xxx(a):
    __type_name__ = 'xxx'
    __mixin__ = True

    a = a

application = Application([IProveedorCentroTFWS],
                          tns='http://impl.ws.application.proveedorcentro.meyss.spee.es',
                          in_protocol=Soap11(),
                          out_protocol=Soap11(
    validator='lxml', cleanup_namespaces=True),
)


@ rpc(ComplexModel.MyRequest, _returns=ComplexModel.xxx, _body_style='bare')
    def actionname(ctx, req):

我已经尝试了所有,我不知道如何达到最高响应,有人可以帮助我吗?

提前致谢

标签: pythonsoapspyne

解决方案


推荐阅读