run()private
No documentation available.
# File lib/soap/rpc/cgistub.rb, line 161
def run
res = WEBrick::HTTPResponse.new({:HTTPVersion => HTTPVersion})
begin
@log.info { "received a request from '#{ @remote_host }'" }
if @fcgi
req = SOAPFCGIRequest.new(@fcgi)
else
req = SOAPStdinRequest.new($stdin)
end
@soaplet.do_POST(req, res)
rescue HTTPStatus::EOFError, HTTPStatus::RequestTimeout => ex
res.set_error(ex)
rescue HTTPStatus::Error => ex
res.set_error(ex)
rescue HTTPStatus::Status => ex
res.status = ex.code
rescue StandardError, NameError => ex # for Ruby 1.6
res.set_error(ex, true)
ensure
if defined?(MOD_RUBY)
r = Apache.request
r.status = res.status
r.content_type = res.content_type
r.send_http_header
buf = res.body
else
buf = ''
res.send_response(buf)
buf.sub!(/^[^\r]+\r\n/, '') # Trim status line.
end
@log.debug { "SOAP CGI Response:\n#{ buf }" }
if @fcgi
@fcgi.out.print buf
@fcgi.finish
@fcgi = nil
else
print buf
end
end
0
end