Example #1
0
        //public NativeAppClient(string url)
        //{
        //    Uri uri = null;
        //    if(Uri.TryCreate(url + urlPath, UriKind.RelativeOrAbsolute, out uri))
        //    {

        //        WSHttpBinding binding = new WSHttpBinding();
        //        binding.Security.Mode = SecurityMode.Transport;
        //        EndpointAddress endpoint = new EndpointAddress(uri);

        //        ChannelFactory<IPINOperations> factory = new ChannelFactory<IPINOperations>(binding, endpoint);
        //        _proxy = factory.CreateChannel();

        //        IgnoreUntrustedSSL();

        //        //var result = _proxy.Logon("abcd", "efgh");
        //    }
        //    else
        //    {
        //        throw new ArgumentException("URL not in correct format: " + url);
        //    }



        //    //_allowUntrustedSSL = ConfigReader.AllowUntrustedSSL;
        //}

        public NativeAppClient(Uri url)
        {
            Uri uri = null;

            if (Uri.TryCreate(url, urlPath, out uri))
            {
                WSHttpBinding binding = new WSHttpBinding();
                binding.Security.Mode = SecurityMode.Transport;
                EndpointAddress endpoint = new EndpointAddress(uri);

                ChannelFactory <ICardPrinting> cardFactory = new ChannelFactory <ICardPrinting>(binding, endpoint);
                _printProxy = cardFactory.CreateChannel();

                ChannelFactory <IPINOperations> pinFactory = new ChannelFactory <IPINOperations>(binding, endpoint);
                _pinProxy = pinFactory.CreateChannel();

                IgnoreUntrustedSSL();
            }
            else
            {
                throw new ArgumentException("URL not in correct format: " + url);
            }
        }
Example #2
0
 public CardPrintingLogic(ICardPrinting cardPrinting, IPrinter printer)
 {
     _cardPrinting = cardPrinting;
     _printer      = printer;
 }
Example #3
0
 public NativeAppClient(ICardPrinting cardPrinting, IPINOperations remoteComponent)
 {
     _printProxy = cardPrinting;
     _pinProxy   = remoteComponent;
 }