How do I keep Spyne from wrapping my response?

谁说胖子不能爱 提交于 2019-12-01 09:24:39

Judging from this request:

<my_method xmlns="my_app_namespace">
  <foo>bar</foo>
<my_method>

You need this:

class MyMethodRequest(ComplexModel):
    foo = Unicode

class MyService(ServiceBase):
    @srpc(MyMethodRequest, _returns=MyMethodRS, _body_style='bare' 
                           _out_variable_name='MyMethodRS')
    def my_method(request):
        foo = request.foo
        response = MyMethodRS()
        response.Version = '1.0'
        return response

Which is very close to what the non-bare mode actually does.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!