当调用Web Service方法时,如何显示由ZSI.ServiceProxy生成的SOAP消息和来自Web Service的响应?
发布于 2009-10-01 04:50:23
下面是关于ServiceProxy类的一些documentation。构造函数接受一个tracefile参数,该参数可以是具有write方法的任何对象,所以这看起来就像您想要的。修改文档中的示例:
from ZSI import ServiceProxy
import BabelTypes
import sys
dbgfile = open('dbgfile', 'w') # to log trace to a file, or
dbgfile = sys.stdout # to log trace to stdout
service = ServiceProxy('http://www.xmethods.net/sd/BabelFishService.wsdl',
tracefile=dbgfile,
typesmodule=BabelTypes)
value = service.BabelFish('en_de', 'This is a test!')
dbgfile.close()https://stackoverflow.com/questions/1497038
复制相似问题