开发者

How can I dump raw XML of my request and server's response using suds in python

开发者 https://www.devze.com 2023-01-26 22:04 出处:网络
i\'m using suds 0.4 and python 2.6, to communicate with remote server. It\'s WSDL loads perfectly, but any function call returns error. Something is wrong with that server.

i'm using suds 0.4 and python 2.6, to communicate with remote server.

It's WSDL loads perfectly, but any function call returns error. Something is wrong with that server.

Now i need to get a dump 开发者_JAVA百科of soap structure, that is sent to server and it's response, in pure soap either.

How can i do that?


Setting the logging for suds.transport to debug will get you the sent and received messages.

For an interactive session, I find this is good:

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)

from suds.client import Client
s = Client('http://someservice?wsdl')

For specifically just the sent and received XML sent to a file, you'll need to play with the logging settings, see http://docs.python.org/library/logging.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号