How can I output what SUDs is generating/receiving?

前端 未结 7 1809
甜味超标
甜味超标 2020-12-01 07:02

I have the following code:

from suds.client import Client
import logging

logging.basicConfig(level=logging.INFO)
logging.getLogger(\'suds.client\').setLevel         


        
相关标签:
7条回答
  • 2020-12-01 08:08

    You can use the MessagePlugin to do this (this will work on the newer Jurko fork where last_sent and last_received have been removed)

    from suds.plugin import MessagePlugin
    
    class LogPlugin(MessagePlugin):
      def sending(self, context):
        print(str(context.envelope))
      def received(self, context):
        print(str(context.reply))
    
    client = Client("http://localhost/wsdl.wsdl", plugins=[LogPlugin()])
    
    0 讨论(0)
提交回复
热议问题