几个月前,我提出了同样的问题,但在较早版本的ZSI (How to display outcoming and incoming SOAP message for ZSI.ServiceProxy in Python?)中。现在,在新版本的ZSI2.1中没有tacefile参数)。我试图找到新版本的文档,但失败了。有人知道如何显示由ZSI2.1生成和接收的SOAP消息吗?预先谢谢:-)
发布于 2010-09-09 15:23:34
为了进行调试,我发现了使用wireshark跟踪TCP包的干扰较少的解决方案。看起来是这样:

发布于 2010-09-09 14:05:07
我也有同样的问题。我的解决办法是修改ZSI附带的dispatch.py文件。
我为我的应用程序创建了一个日志函数(logmessage),将SOAP消息存储到数据库中,然后在必要时添加该函数。然而,我不记得我使用的ZSI版本。不过,您应该能够很容易地在代码中找到这些函数。因为我做了其他的编辑,所以我有近似的L数
在站点包目录中的Dispatch.py文件中。
L156 -日志SOAP响应
def _Dispatch(tons-of-args, **kw):
#several lines of code edited here#
#several lines of code edited here#
#several lines of code edited here#
sw = SoapWriter(nsdict=nsdict)
sw.serialize(result, tc)
logmessage( str(sw), 1, kw['request'].get_remote_host() ) #LOGGING HEREL168 -记录SOAP错误
def _ModPythonSendFault(f, **kw):
logmessage( str(f.AsSOAP()), 1, kw['request'].get_remote_host() ) #LOGGING ADDED HERE
_ModPythonSendXML(f.AsSOAP(), 500, **kw)L277 -记录请求
def AsHandler(request=None, modules=None, **kw):
'''Dispatch from within ModPython.'''
a = request.read(-1)
logmessage( a, 0, request.get_remote_host() ) #LOGGING ADDED HERE
ps = ParsedSoap(a)
kw['request'] = request
_Dispatch(ps, modules, _ModPythonSendXML, _ModPythonSendFault, **kw)https://stackoverflow.com/questions/3676409
复制相似问题