Represents a XML Remote Procedure Call (XML-RPC) request message.

Namespace:  Argotic.Core.Net
Assembly:  Argotic.Core (in Argotic.Core)
Version: 2007.3.0.0 (2007.3.0.0)

Syntax

C#
[SerializableAttribute]
public class XmlRpcMessage : IComparable
Visual Basic (Declaration)
<SerializableAttribute> _
Public Class XmlRpcMessage _
	Implements IComparable
Visual C++
[SerializableAttribute]
public ref class XmlRpcMessage : IComparable

Remarks

XML-RPC is a Remote Procedure Calling protocol that provides simple cross-platform distributed computing based on the standards of the Internet.

See http://www.xmlrpc.com/spec for more information on the XML-RPC protocol specification.

Examples

The following code example demonstrates the usage of XmlRpcMessage.
CopyC#
using System;
using System.Text;

using Argotic.Core.Net;

namespace Argotic.Test
{
    public class XmlRpcMessageCS
    {
        public XmlRpcMessageCS()
        {
            //------------------------------------------------------------
            //    Initialize the XML-RPC client
            //------------------------------------------------------------
            XmlRpcClient client         = new XmlRpcClient();
            client.Timeout              = TimeSpan.FromSeconds(10);

            //------------------------------------------------------------
            //    Define the XML-RPC message to send
            //------------------------------------------------------------
            XmlRpcMessage message       = new XmlRpcMessage();
            message.Encoding            = Encoding.UTF8;
            message.UserAgent           = "Frontier/5.1.2 (WinNT)";
            message.MethodName          = "examples.getStateName";

            XmlRpcParameter parameter   = new XmlRpcParameter();
            parameter.ParameterType     = XmlRpcParameterType.Integer;
            parameter.Value             = 41;
            message.Parameters.Add(parameter);

            //------------------------------------------------------------
            //    Send the XML-RPC message
            //------------------------------------------------------------
            XmlRpcResponse xmlRpcResponse;

            Uri xmlRpcServiceHost       = new Uri("betty.userland.com/RPC2");
            xmlRpcResponse              = client.Send(xmlRpcServiceHost, message);

            //------------------------------------------------------------
            //    Determine if remote procedure call was sucessful
            //------------------------------------------------------------
            if(xmlRpcResponse.HasFault)
            {
                //------------------------------------------------------------
                //    Get reason provided for remote procedure call failure
                //------------------------------------------------------------
                int faultCode       = xmlRpcResponse.FaultCode;
                string faultReason  = xmlRpcResponse.FaultReason;
            }
        }
    }
}

Inheritance Hierarchy

System..::.Object
  Argotic.Core.Net..::.XmlRpcMessage

See Also