1

Web サービス メソッドが呼び出されたときに、ZSI.ServiceProxy によって生成された SOAP メッセージと Web サービスからの応答を表示する方法は?

4

1 に答える 1

3

これは、ServiceProxyクラスに関するいくつかのドキュメントです。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()
于 2009-10-01T04:50:22.890 に答える