Suds 客户端忽略插件对发送方法所做的修改 [英] Suds Client ignores modification done by plugins into sending method

查看:64
本文介绍了Suds 客户端忽略插件对发送方法所做的修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用插件对发送进行修改.

I am trying to use a plugin doing modification on sending.

修改完成,但suds在修改前发送肥皂.

Modification are done, but suds sends the soap before the modification.

在对我的插件进行长时间搜索后,我最终查看了 suds 来源.

After a long search into my plugin, I finish by looking the suds sources.

进入client.py文件,send函数调用插件:

Into the client.py file, the send function calls the plugins:

 plugins.message.sending(envelope=soapenv)

但是在这个调用之后soapenv仍然和以前一样.

but after this call soapenv is still as previous.

当插件返回 ctx 时,我修补

As plugins return the ctx, I patch with

res = plugins.message.sending(envelope=soapenv)
soapenv = res.envelope

它现在按预期工作.由于 soapenv 是一个字符串,我认为 Python 按值传递它,所以我不明白没有这种补丁它是如何工作的.

and it is now working as expected. As soapenv is a string, I think Python pass it by value so I don't get how it can work without this kind of patch.

为什么我需要这个补丁?我做错了什么?

Why I need this patch ? What I am doing wrong ?

使用的版本:

Python 2.7.9(默认,2016 年 6 月 29 日,13:08:31)[GCC 4.9.2] 在 linux2 上

Python 2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2] on linux2

泡沫 (0.4)

推荐答案

sud 不应该用,jurko fork 更好,解决这个问题

Sud should not be used, jurko fork is better and fix this issue

这篇关于Suds 客户端忽略插件对发送方法所做的修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆