首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Python中显示ZSI.ServiceProxy的出站和入站SOAP消息?

如何在Python中显示ZSI.ServiceProxy的出站和入站SOAP消息?
EN

Stack Overflow用户
提问于 2009-09-30 09:33:13
回答 1查看 1.1K关注 0票数 1

当调用Web Service方法时,如何显示由ZSI.ServiceProxy生成的SOAP消息和来自Web Service的响应?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2009-10-01 04:50:23

下面是关于ServiceProxy类的一些documentation。构造函数接受一个tracefile参数,该参数可以是具有write方法的任何对象,所以这看起来就像您想要的。修改文档中的示例:

代码语言:javascript
复制
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()
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1497038

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档