1

How to display a SOAP message generated by ZSI.ServiceProxy and a respond from a Web Service when a Web Service method is invoked?

czuk
  • 6,218
  • 10
  • 36
  • 47

1 Answers1

3

Here is some documentation on the ServiceProxy class. The constructor accepts a tracefile argument which can be any object with a write method, so this looks like what you are after. Modifying the example from the documentation:

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()
mhawke
  • 84,695
  • 9
  • 117
  • 138