/* * DotGNU DGEE Protocol Service * * Copyright (C) 2003 DotGNU Project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * * $Revision: 1.1.2.1 $ $Date: 2003/07/29 01:42:03 $ * * -------------------------------------------------------------------------- * * Authors: * Nicolai P Guba */ using System; using System.IO; namespace DotGNU.DGEE.Protocols { public class XmlRpcProtocolHandler : IProtocolHandler { public object Request( StreamReader input ) { string buf = input.ReadToEnd(); // Handle any incoming request Console.Out.WriteLine( ">>> Request: {0}", buf ); // Determine the method from the protocol Console.Out.WriteLine( "--- Deserialising" ); return buf; } public object Invoke( object o ) { // Invoke the method Console.Out.WriteLine( "--- Invoking" ); return "Hello NPG!!! I've been invoked. yes yes yessss!"; } public void Error( Stream output ) { } public void Response( StreamWriter output, object o ) { output.Write( o ); // Serialise the result of the method Console.Out.WriteLine( "--- Serialising: {0}", o ); // Send it back to the client Console.Out.WriteLine( "<<< Response" ); } } }