static void Main(string[] args) { const string serverUrl = "http://localhost:12345/"; var transferServer = new TransferServer(new RequestHandler()); using (new HttpListenerTransferEndpoint(serverUrl, transferServer)) { var transferClient = new SOAPClient(serverUrl); Console.Write("Create..."); var address = transferClient.BuildMessage().Create(new SampleData()); Console.WriteLine(address.Address); Console.Write("Put..."); var data = transferClient.BuildMessage().Put<SampleData>(new SampleData {A = "AAA"}); Console.WriteLine(data.A); Console.Write("Get..."); data = transferClient.BuildMessage().Get<SampleData>(); Console.WriteLine(data.A); Console.Write("Delete..."); transferClient.BuildMessage(); Console.WriteLine("OK"); Console.WriteLine("Press any key to exit"); Console.ReadKey(); } }
public static void RegisterRoutes(RouteCollection routes) { var handler = new ManagementTransferRequestHandler(); handler.Bind(ResourceUri, new Handler()); var transferServer = new TransferServer(handler); routes.Add(new Route("management", new SOAPRouteHandler(transferServer))); }
static void Main(string[] args) { XmlConfigurator.Configure(); var handler = new ManagementTransferRequestHandler(); handler.Bind(ResourceUri, new Handler()); var transferServer = new TransferServer(handler); using (new HttpListenerTransferEndpoint("http://localhost:12345/", transferServer)) { Client.PerformTest(); Console.WriteLine("Press any key to exit."); Console.ReadKey(); } }