开发者

Ruby: Soap4r: How do I get the raw request sent to my soap server?

I h开发者_运维百科ave a connection open and am doing:

values = [1, 'test']
connection.return_response_as_xml = true
response = connection.send(method_name.to_sym(), *values)

and that works fine and all. but I want to see the raw request sent across... is this possible?


I'd recommend using Savon (http://github.com/rubiii/savon) if possible. I know Savon will log the request and the response by default.


I use the following to write my xml requests and responses to the console.

service = WebServiceSoap.new
service.wiredump_dev = STDERR;


It's been ages since I worked with soap4r (I do all SOAP work with Savon these days), but as far as I can remember this should do the trick:

connection.wiredump_file_base = 'log/soap/' # or whatever directory you want log files in

Bear in mind that with this, the log files will be overwritten with each call.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜