nearlloner
New Member
\[code\]require 'open-uri'require 'cgi'require 'rexml/document'include REXMLrequire 'erb'## - using datanoise actionwebservice 2.3.5 for rails 2.3.5 on ruby 1.8.7# ... in one of the actionwebservice methods making a post XML to another webserviceurl = URI.parse("https://some.externalservice.url")http = Net::HTTP.new(url.host, url.port)http.use_ssl = true# tried this but it doesn't output anything to nohup.out or development.loghttp.set_debug_output($stdout)http.verify_mode = OpenSSL::SSL::VERIFY_NONEhttp.read_timeout = 80request = Net::HTTP:ost.new(url.path)request.content_type = 'text/xml'# Using brequest.body = post_request.result(binding).gsub("\n","")response = http.request(request)# This worked from a standalone ruby client but not from rails# puts response.bodydocRes = Document.new(response.body)## ... continue processing the response XML\[/code\]In my webservice controller code snippet, I call an external SOAP webservice as a simple http POST of the XML, but I'd like to log the request and response SOAP XML to either a new logfile or at a minimum the standard development.log file. Since I run on Linux, the only way I know to start rails on the default mongrel server is: nohup ruby script/server start & - which ends up creating a parallel nohup.out since I want to keep the server running even when I logoff. Whats the right way to do this? The nohup.out obviously grows like my development.log and pretty much has the same stuff.