/// <summary>The application starts here.</summary>
    /// <remarks>This method instantiates an <c>XmlRpcServer</c> as an embedded XML-RPC server,
    /// then add this object to the server as an XML-RPC handler, and finally starts the server.</remarks>
    public static void Main() 
      {
	XmlRpcServer server = new XmlRpcServer(PORT);
	server.Add("sample", new SampleServerWithExpose());
	Console.WriteLine("Web Server Running on port {0} ... Press ^C to Stop...", PORT);
	server.Start();
      }
예제 #2
0
        /// <summary>Handle an HTTP request containing an XML-RPC request.</summary>
        /// <remarks>This method deserializes the XML-RPC request, invokes the
        /// described method, serializes the response (or fault) and sends the XML-RPC response
        /// back as a valid HTTP page.
        /// </remarks>
        /// <param name="httpReq"><c>SimpleHttpRequest</c> containing the request.</param>
        public void Respond(SimpleHttpRequest httpReq)
        {
            XmlRpcRequest  xmlRpcReq  = (XmlRpcRequest)_deserializer.Deserialize(httpReq.Input);
            XmlRpcResponse xmlRpcResp = new XmlRpcResponse();

            try
            {
                xmlRpcResp.Value = _server.Invoke(xmlRpcReq);
            }
            catch (XmlRpcException e)
            {
                xmlRpcResp.SetFault(e.FaultCode, e.FaultString);
            }
            catch (Exception e2)
            {
                xmlRpcResp.SetFault(XmlRpcErrorCodes.APPLICATION_ERROR,
                                    XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": " + e2.Message);
            }

            if (Logger.Delegate != null)
            {
                Logger.WriteEntry(xmlRpcResp.ToString(), LogLevel.Information);
            }

            XmlRpcServer.HttpHeader(httpReq.Protocol, "text/xml", 0, " 200 OK", httpReq.Output);
            httpReq.Output.Flush();
            XmlTextWriter xml = new XmlTextWriter(httpReq.Output);

            _serializer.Serialize(xml, xmlRpcResp);
            xml.Flush();
            httpReq.Output.Flush();
        }
예제 #3
0
파일: Program.cs 프로젝트: jvanveen/ppt2os
 static void Main(string[] args)
 {
     IConfigSource config = new IniConfigSource("../../ppt2os.ini");
     int port = config.Configs["uploader"].GetInt("port");
     XmlRpcServer server = new XmlRpcServer(port);
     server.Add("exposed", new XMLRPC_Service(config));
     Console.WriteLine("Web Server Running on port {0} ... Press ^C to Stop...", port);
     server.Start();
 }
예제 #4
0
    /// <summary>The application starts here.</summary>
    /// <remarks>This method instantiates an <c>XmlRpcServer</c> as an embedded XML-RPC server,
    /// then add this object to the server as an XML-RPC handler, and finally starts the server.</remarks>
    public static void Main() 
      {
	// Use the console logger above.
	Logger.Delegate = new Logger.LoggerDelegate(WriteEntry);

	XmlRpcServer server = new XmlRpcServer(PORT);
	server.Add("sample", new SampleServer());
	Console.WriteLine("Web Server Running on port {0} ... Press ^C to Stop...", PORT);
	server.Start();
      }
    public XmlRpcSystemObject(XmlRpcServer server)
      {
	_server = server;
	server.Add("system",this);
      }
예제 #6
0
 /// <summary>Constructor.</summary>
 /// <param name="server"><c>XmlRpcServer</c> server to be the system object for.</param>
 public XmlRpcSystemObject(XmlRpcServer server)
 {
     _server = server;
     server.Add("system", this);
     MethodHelp.Add(GetType().FullName + ".methodHelp", "Return a string description.");
 }
 /// <summary>Constructor.</summary>
 /// <param name="server"><c>XmlRpcServer</c> server to be the system object for.</param>
 public XmlRpcSystemObject(XmlRpcServer server)
 {
     _server = server;
     server.Add("system", this);
     _methodHelp.Add(this.GetType().FullName + ".methodHelp", "Return a string description.");
 }
예제 #8
0
 public XmlRpcSystemObject(XmlRpcServer server)
 {
     _server = server;
     server.Add("system", this);
 }
예제 #9
0
 /// <summary>Basic constructor.</summary>
 /// <param name="server">XmlRpcServer that this XmlRpcResponder services.</param>
 /// <param name="client">TcpClient with the connection.</param>
 public XmlRpcResponder(XmlRpcServer server, TcpClient client)
 {
     _server  = server;
     _client  = client;
     _httpReq = new SimpleHttpRequest(_client);
 }
예제 #10
0
    /// <summary>Basic constructor.</summary>
    /// <param name="server">XmlRpcServer that this XmlRpcResponder services.</param>
    /// <param name="client">TcpClient with the connection.</param>
    public XmlRpcResponder(XmlRpcServer server, TcpClient client)
      {
	_server = server;
	_client = client;
	_httpReq = new SimpleHttpRequest(_client);
      }
예제 #11
0
        public static void Main(string[] args)
        {           
            // XML-RPC-Stuff
            // Use the console logger above.
            Nwc.XmlRpc.Logger.Delegate = new Nwc.XmlRpc.Logger.LoggerDelegate(WriteEntry);

            XmlRpcSLConnector = new XmlRpcServer(port);
            XmlRpcSLConnector.Add("XmlRpcSLConnector", new CSSLAgentServer());
            Console.WriteLine("Web Server Running on port {0} ... Press ^C to Stop...", port);
            XmlRpcSLConnector.Start();
        }