Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/345.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Python(版本2.1)中显示ZSI.ServiceProxy的传出和传入SOAP消息?_Python_Soap_Zsi - Fatal编程技术网

如何在Python(版本2.1)中显示ZSI.ServiceProxy的传出和传入SOAP消息?

如何在Python(版本2.1)中显示ZSI.ServiceProxy的传出和传入SOAP消息?,python,soap,zsi,Python,Soap,Zsi,几个月前,我问过同样的问题,但是在ZSI()的旧版本中。现在,在新版本的ZSI 2.1中没有tacefile参数)。我试图找到新版本的文档,但失败了有人知道如何显示ZSI 2.1生成和接收的SOAP消息吗?提前感谢:-)我也遇到了同样的问题。我的解决方法是修改ZSI附带的dispatch.py文件 我为我的应用程序创建了一个日志函数(logmessage),它将SOAP消息存储到数据库中,然后在必要时添加该函数。但是,我不记得我使用的ZSI版本。不过,您应该能够在代码中很容易地找到这些函数。自从

几个月前,我问过同样的问题,但是在ZSI()的旧版本中。现在,在新版本的ZSI 2.1中没有
tacefile
参数)。我试图找到新版本的文档,但失败了有人知道如何显示ZSI 2.1生成和接收的SOAP消息吗?提前感谢:-)

我也遇到了同样的问题。我的解决方法是修改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 HERE
L168-记录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)

我也有同样的问题。我的解决方法是修改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 HERE
L168-记录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)

为了调试,我找到了使用wireshark跟踪TCP包的干扰较小的解决方案。看起来是这样的:


为了调试,我找到了使用wireshark跟踪TCP包的干扰较小的解决方案。看起来是这样的: