예제 #1
0
파일: Form1.cs 프로젝트: gpanayir/sffwk
        private void button2_Click(object sender, EventArgs e)
        {
            
            ServiceReference1.ExecuteServiceRequest req = new ServiceReference1.ExecuteServiceRequest();

            SomeCompany.BE.AccountBE account = new SomeCompany.BE.AccountBE();
            account.Name = "alskflH FLADSKFÑL SFFSADF FSDFSF";
            account.Id = 12342134;
            account.TypeId = 1009;
            req.jsonRequets = Newtonsoft.Json.JsonConvert.SerializeObject(account, Newtonsoft.Json.Formatting.Indented);


            NetTcpBinding binding = new NetTcpBinding();
            binding.Name = "tcp";

            EndpointAddress address = new EndpointAddress("net.tcp://localhost:8001/FwkService");
            using (ServiceReference1.FwkServiceClient svcProxy = new ServiceReference1.FwkServiceClient(binding, address))
            {
                svcProxy.Open();
                ServiceReference1.ExecuteServiceResponse res = svcProxy.ExecuteService(req);


            }

        }
예제 #2
0
파일: Form1.cs 프로젝트: gpanayir/sffwk
 void checkProxy()
 {
     if(svcProxy==null)
     {
         svcProxy = new ServiceReference1.FwkServiceClient("FirstEndpoint");
         svcProxy.Open();
     }
 }