Пример #1
0
 public string echo(string message)
 {
     if (!Connected)
     {
         throw new Exception("Not Connected");
     }
     try
     {
         return(proxy.Echo(message));
     }
     catch (Exception x)
     {
         return(x.Message);
     }
 }
Пример #2
0
        //public bool Connect(string url)
        //{
        //    serviceUrl = url;
        //    return Connect();
        //}

        public bool Connect()
        {
            try
            {
                var binding  = new BasicHttpBinding(BasicHttpSecurityMode.None);
                var endpoint = new EndpointAddress(serviceUrl);
                var factory  = new ChannelFactory <fiskaltrust.ifPOS.v0.IPOS>(binding, endpoint);
                proxy = factory.CreateChannel();
                proxy.Echo(DateTime.Now.ToString());
            }
            catch (Exception)
            {
                proxy = null;
            }
            return(Connected);
        }
Пример #3
0
        //public bool Connect(string url)
        //{
        //    serviceUrl = url;
        //    return Connect();
        //}

        public bool Connect()
        {
            try
            {
                var binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
                var endpoint = new EndpointAddress(serviceUrl);
                var factory = new ChannelFactory<fiskaltrust.ifPOS.v0.IPOS>(binding, endpoint);
                proxy = factory.CreateChannel();
                proxy.Echo(DateTime.Now.ToString());
            }
            catch (Exception)
            {
                proxy = null;
            }
            return Connected;
        }