开发者

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

开发者 https://www.devze.com 2023-01-19 00:42 出处:网络
I h开发者_运维百科ave a connection open and am doing: values = [1, \'test\'] connection.return_response_as_xml = true

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

精彩评论

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