客户端
using CookComputing.XmlRpc;
using System;
namespace BM.Leader.Net
{
public struct StateStructRequest
{
public int state1;
public int state2;
public int state3;
}
[XmlRpcUrl("http://localhost:7762/StateNameServer.ashx")]
public interface IStateName : IXmlRpcProxy
{
[XmlRpcMethod("examples.getStateName")]
string GetStateName(int stateNumber);
[XmlRpcBegin("examples.getStateName")]
IAsyncResult BeginGetStateName(int stateNumber);
[XmlRpcEnd]
string EndGetStateName(IAsyncResult asr);
[XmlRpcMethod("examples.getStateStruct")]
string GetStateNames(StateStructRequest request);
}
public class RPCHelper
{
public void TestRPC()
{
try
{
IStateName proxy = XmlRpcProxyGen.Create<IStateName>();
Console.WriteLine("Synchronous call:");
string ret = proxy.