예제 #1
0
        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();
            }
        }
예제 #2
0
        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)));
        }
예제 #3
0
        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();
            }
        }