# File lib/soap/rpc/soaplet.rb, line 84
  def do_POST(req, res)
    logger.debug { "SOAP request: " + req.body } if logger
    if @authenticator
      @authenticator.authenticate(req, res)
      # you can check authenticated user with SOAP::RPC::SOAPlet.user
    end
    begin
      conn_data = ::SOAP::StreamHandler::ConnectionData.new
      setup_req(conn_data, req)
      @router.external_ces = @options[:external_ces]
      Mapping.protect_threadvars(:SOAPlet) do
        SOAPlet.user = req.user
        SOAPlet.cookies = req.cookies
        conn_data = @router.route(conn_data)
        setup_res(conn_data, req, res)
      end
    rescue Exception => e
      conn_data = @router.create_fault_response(e)
      res.status = WEBrick::HTTPStatus::RC_INTERNAL_SERVER_ERROR
      res.body = conn_data.send_string
      res['content-type'] = conn_data.send_contenttype || "text/xml"
    end
    if res.body.is_a?(IO)
      res.chunked = true
      logger.debug { "SOAP response: (chunked response not logged)" } if logger
    else
      logger.debug { "SOAP response: " + res.body } if logger
    end
  end