如何输出正在生成/接收的 SUD? [英] How can I output what SUDs is generating/receiving?

查看:40
本文介绍了如何输出正在生成/接收的 SUD?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码:

from suds.client import Client导入日志logging.basicConfig(level=logging.INFO)logging.getLogger('suds.client').setLevel(logging.DEBUG)logging.getLogger('suds.transport').setLevel(logging.DEBUG)logging.getLogger('suds.xsd.schema').setLevel(logging.DEBUG)logging.getLogger('suds.wsdl').setLevel(logging.DEBUG)SB_PRIVATE_ACCESS = {"PATH":"https://thisurl.com:443/services/",}客户端 = 客户端(SB_PRIVATE_ACCESS['PATH'])打印客户端

但是我收到了 500 个错误.我正在尝试将通过 SUD 生成和接收的 XML 发送给 wsdl 开发人员,但我不知道如何输出它?我一直在查看 SUD 的文档,但似乎找不到它:/有谁知道如何输出发送和接收的原始 xml?

解决方案

SUDS 提供了一些方便的方法来做到这一点:

 client.last_sent()client.last_received()

这些应该为您提供所需的东西.我用它们来记录错误.Client 类的 API 文档 应该有您需要的任何额外信息.>

I have the following code:

from suds.client import Client
import logging

logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
logging.getLogger('suds.transport').setLevel(logging.DEBUG)
logging.getLogger('suds.xsd.schema').setLevel(logging.DEBUG)
logging.getLogger('suds.wsdl').setLevel(logging.DEBUG)

SB_PRIVATE_ACCESS = {"PATH":"https://thisurl.com:443/services/",}

client = Client(SB_PRIVATE_ACCESS['PATH'])
print client

but I am getting 500 errors. I am trying to send what XML is being generated and received through SUDs, to the wsdl developer, but I can't figure how to output it? I have been looking in the documentation of SUDs, but can't seem to find it :/ Does anyone know how to output the raw xml that is sent and received?

解决方案

SUDS provides some convenience methods to do just that:

 client.last_sent()
 client.last_received()

These should provide you with what you need. I use them for error logging. The API doc for Client class should have any extra info you need.

这篇关于如何输出正在生成/接收的 SUD?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆