I'm using Savon gem in Ruby on Rails to communicate with a wsdl WS. Everything is working fine, but I want to log the request XML using a custom log, i.e. not Rails or Savon logger. My code looks something like this:
response = self.client.request :add_order do
soap.body = {
:indata => {
"CustomerNo" => config[:kundnr],
"Pwd" => config[:password],
"OrderDate" => order["purchase_order_date"].strftime('%Y%m%d')
}
}
end
Accessing the response is no problem, but what about the request? I need to be able to see what has been sent in my production environment by logging the XML to a DB-field.