Spyne - 如何接受 SOAP 端点中的键值对?

Spyne - How do I accept key value pairs in a SOAP endpoint?

我正在尝试构建一个 SOAP 服务,我想将类似下面的内容传递给端点。

    <payload>
        <initiation_date>2019-05-17T00:00:00.000</initiation_date>
        <facility_num>123</facility_num>
        <order_num>123</order_num>
    </payload>  

我想要实现的是在我的端点中获得 dict

我的端点是这样的:

class SoapService(ServiceBase):

    @rpc(Unicode, Unicode, Unicode, Array(Unicode), _returns=String)
        def soap_service(self, email, password, action, payload):

我的 soap_service 端点需要的是:

payload = {
              'initiation_date': '2019-05-17T00:00:00.000',
              'facility_num': '123',
              'order_num': '123'
          }

如何实现?

非常感谢您的帮助!

想通了,我只需要将装饰器中的负载 type 更改为 AnyDict

这个有效:

@rpc(Unicode, Unicode, Unicode, AnyDict, _returns=String)
        def soap_service(self, email, password, action, payload):

谢谢!