Example #1
0
        public override void handlePOSTRequest(HttpProcessor p, StreamReader inputData)
        {
            Console.WriteLine("POST request: {0}", p.http_url);
            // write source in post body to server file
            StreamWriter file = new StreamWriter("temp.abap");
            inputData.BaseStream.CopyTo(file.BaseStream);
            file.Close();
            // compile
            openABAP.Compiler.Compiler compiler = new openABAP.Compiler.Compiler("temp.abap");
            try {
                compiler.Compile();
                compiler.Run ();
                p.outputStream.WriteLine(openABAP.Runtime.Runtime.Output);
            } catch (openABAP.Compiler.CompilerError ex) {
                p.outputStream.WriteLine(ex.Message);
                p.outputStream.WriteLine(compiler.GetErrors());
            }

            // ready
            //p.writeSuccess();
        }
Example #2
0
        public override void handlePOSTRequest(HttpProcessor p, StreamReader inputData)
        {
            Console.WriteLine("POST request: {0}", p.http_url);
            // write source in post body to server file
            StreamWriter file = new StreamWriter("temp.abap");

            inputData.BaseStream.CopyTo(file.BaseStream);
            file.Close();
            // compile
            openABAP.Compiler.Compiler compiler = new openABAP.Compiler.Compiler("temp.abap");
            try {
                compiler.Compile();
                compiler.Run();
                p.outputStream.WriteLine(openABAP.Runtime.Runtime.Output);
            } catch (openABAP.Compiler.CompilerError ex) {
                p.outputStream.WriteLine(ex.Message);
                p.outputStream.WriteLine(compiler.GetErrors());
            }

            // ready
            //p.writeSuccess();
        }