SOAPpy 返回 XML 字符串。如何让库为我解析 xml?

发布于 2024-11-05 23:09:42 字数 533 浏览 12 评论 0原文

我正在使用 SOAPpy,并深入了解 Python http://diveintopython3.ep.io/http- web-services.html 表示它应该返回一个字典。
我正在发出一个简单的请求,该请求返回一个包含转义字符的 xml 响应。

WSDLFILE = 'path/to/my/wsdl'
_server = WSDL.Proxy(WSDLFILE)
print _server.validServerMethod(client,password)

这会返回一个丑陋的 xml 字符串

任何人都可以帮我让它返回一个已经解析的响应吗? 感谢您抽出时间。

I am using SOAPpy, and Dive Into Python http://diveintopython3.ep.io/http-web-services.html says it should be returning a dictionary.
I am making a simple request, that returns an xml response that has the escape characters.

WSDLFILE = 'path/to/my/wsdl'
_server = WSDL.Proxy(WSDLFILE)
print _server.validServerMethod(client,password)

This returns a big ugly str of xml
<?xml version="1.0" encoding="utf-8"?><it....

Can anyone help me with getting this to return an already parsed response?
Thank you for your time.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

缪败 2024-11-12 23:09:42

我认为你需要转义它: http://wiki.python.org/moin/EscapingHtml

I think you need to unescape it : http://wiki.python.org/moin/EscapingHtml

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文