private static void InitialiseService()
        {
            try
            {
                if (object.Equals(_iBankingService, null))
                {
                    var svssAddrService = SVSSAdapter.GetItemsByTag("VCB_IBanking");

                    var client   = ConfigurationManager.GetSection("system.serviceModel/client") as ClientSection;
                    var endpoint = client.Endpoints.Cast <ChannelEndpointElement>().FirstOrDefault(x => x.Name == "IBSAperioSoap");

                    BasicHttpSecurityMode securityMode = ServiceHost.Equals("https", StringComparison.InvariantCultureIgnoreCase) ? BasicHttpSecurityMode.Transport : BasicHttpSecurityMode.None;;
                    BasicHttpBinding      binding      = new BasicHttpBinding(securityMode);
                    binding.MaxReceivedMessageSize = int.MaxValue;
                    binding.MaxBufferSize          = int.MaxValue;
                    var svssValue = svssAddrService.FirstOrDefault().Value;
                    if (string.IsNullOrEmpty(svssValue))
                    {
                        svssValue = "http://10.10.107.174:8088/IBS_Aperio.asmx";
                    }
                    Uri uri = new Uri(svssValue);
                    //Uri uri = new Uri("http://10.10.107.174:8088/IBS_Aperio.asmx");
                    //Uri uri = new Uri(endpoint.Address);
                    _iBankingService = new BSAperioSoapClient(binding, new EndpointAddress(uri));
                    if (object.Equals(_iBankingService, null))
                    {
                        Utilities.WriteToEventLog("VCB IBanking Service", "Failed to initialise ServiceWithTokenSoap", "ServiceWithTokenSoap", 1, EventLogEntryType.Error);
                    }
                }
            }
            catch (Exception ex)
            {
                Utilities.WriteToEventLog("VCB IBanking Service", ex, "Failed to initialise the ServiceWithTokenSoap adapter.", 1, EventLogEntryType.Error);
            }
        }
        private static void InitialiseService()
        {
            try
            {
                var svssAddrService = SVSSAdapter.GetItemsByTag("VCB_AutoDebit");
                var client          = ConfigurationManager.GetSection("system.serviceModel/client") as ClientSection;
                var endpoint        = client.Endpoints.Cast <ChannelEndpointElement>().FirstOrDefault(x => x.Name == "AutoDebitServiceMSSoap");

                BasicHttpSecurityMode securityMode = ServiceHost.Equals("https", StringComparison.InvariantCultureIgnoreCase) ? BasicHttpSecurityMode.Transport : BasicHttpSecurityMode.None;;
                BasicHttpBinding      binding      = new BasicHttpBinding(securityMode);
                binding.MaxReceivedMessageSize = int.MaxValue;
                binding.MaxBufferSize          = int.MaxValue;
                var svssValue = svssAddrService.FirstOrDefault().Value;
                if (string.IsNullOrEmpty(svssValue))
                {
                    svssValue = "http://10.1.9.228:8089/MosaicServiceTest/AutoDebitServiceMS.asmx";
                }
                Uri uri = new Uri(svssValue);
                //Uri uri = //new Uri("http://10.1.9.228:8089/MosaicServiceTest/AutoDebitServiceMS.asmx");
                //Uri uri = new Uri(endpoint.Address);
                _autoDebitService = new AutoDebitServiceMSSoapClient(binding, new EndpointAddress(uri));
                // _autoDebitSoap1 = new AutoDebitServiceMSSoap1Client(binding, new EndpointAddress(uri));
            }
            catch (Exception ex)
            {
                //Utilities.WriteToEventLog("VCB AutoDebit Service", ex, "Failed to initialise the AutoDebitService adapter.", 1, EventLogEntryType.Error);
            }
        }
예제 #3
0
        private static void InitialiseService()
        {
            try
            {
                if (object.Equals(_mBankingService, null))
                {
                    //var mBankUrl = SVSSAdapter.GetItemsByTag("VCB_MBanking");
                    //if (mBankUrl != null & mBankUrl.Count() > 0)
                    //{
                    //    BasicHttpSecurityMode securityMode = ServiceHost.Equals("https", StringComparison.InvariantCultureIgnoreCase) ? BasicHttpSecurityMode.Transport : BasicHttpSecurityMode.None; ;
                    //    BasicHttpBinding binding = new BasicHttpBinding(securityMode);
                    //    binding.MaxReceivedMessageSize = int.MaxValue;
                    //    binding.MaxBufferSize = int.MaxValue;
                    //    Uri uri = new Uri(mBankUrl.FirstOrDefault().Value);
                    //    _mBankingService = new VcbInternetBankingSoapClient(binding, new EndpointAddress(uri));
                    //}
                    //else
                    //{
                    //    Utilities.WriteToEventLog("VCB Mobilebanking Service", "No URL for web service VCB_MBanking", "VCB_MBanking", 1, EventLogEntryType.Error);
                    //}
                    //if (object.Equals(_mBankingService, null))
                    //{
                    //    Utilities.WriteToEventLog("VCB Mobilebanking Service", "Failed to initialise BasicHttpsBinding_VcbInternetBankingSoap", "BasicHttpsBinding_VcbInternetBankingSoap", 1, EventLogEntryType.Error);
                    //}
                    var svssAddrService = SVSSAdapter.GetItemsByTag("VCB_MBanking");

                    var client   = ConfigurationManager.GetSection("system.serviceModel/client") as ClientSection;
                    var endpoint = client.Endpoints.Cast <ChannelEndpointElement>().FirstOrDefault(x => x.Name == "VcbInternetBankingSoap");

                    BasicHttpSecurityMode securityMode = ServiceHost.Equals("https", StringComparison.InvariantCultureIgnoreCase) ? BasicHttpSecurityMode.Transport : BasicHttpSecurityMode.None;;
                    BasicHttpBinding      binding      = new BasicHttpBinding(securityMode);
                    binding.MaxReceivedMessageSize = int.MaxValue;
                    binding.MaxBufferSize          = int.MaxValue;
                    var svssValue = svssAddrService.FirstOrDefault().Value;
                    if (string.IsNullOrEmpty(svssValue))
                    {
                        svssValue = "http://192.168.186.220:8090/IBSvr/InternetBankingSvc.asmx";
                    }
                    Uri uri = new Uri(svssValue);
                    //Uri uri = new Uri("http://192.168.186.220/IBSrv/InternetBankingSvc.asmx");
                    //Uri uri = new Uri(endpoint.Address);
                    //_mBankingService = new VcbInternetBankingSoapClient(binding, new EndpointAddress(uri));
                    _mBankingService = new AperioWebServiceSoapClient(binding, new EndpointAddress(uri));
                    if (object.Equals(_mBankingService, null))
                    {
                        Utilities.WriteToEventLog("VCB VcbInternetBankingSoapClient Service", "Failed to initialise VcbInternetBankingSoapClient", "VcbInternetBankingSoapClient", 1, EventLogEntryType.Error);
                    }
                }
            }
            catch (Exception ex)
            {
                Utilities.WriteToEventLog("VCB Mobilebanking Service", ex, "Failed to initialise the BasicHttpsBinding_VcbInternetBankingSoap adapter.", 1, EventLogEntryType.Error);
            }
        }
예제 #4
0
        private static void InitialiseService()
        {
            try
            {
                if (object.Equals(_smsService, null))
                {
                    //var smsUrl = SVSSAdapter.GetItemsByTag("VCB_SMS");
                    //if (smsUrl != null & smsUrl.Count() > 0)
                    //{
                    //    BasicHttpSecurityMode securityMode = ServiceHost.Equals("https", StringComparison.InvariantCultureIgnoreCase) ? BasicHttpSecurityMode.Transport : BasicHttpSecurityMode.None;
                    //    BasicHttpBinding binding = new BasicHttpBinding(securityMode);
                    //    binding.MaxReceivedMessageSize = int.MaxValue;
                    //    binding.MaxBufferSize = int.MaxValue;
                    //    Uri uri = new Uri("http://10.1.9.228/SMSWS/SMSService.asmx");
                    //    _smsService = new VCBWSSoapClient(binding, new EndpointAddress(uri));
                    //}
                    //else
                    //{
                    //    Utilities.WriteToEventLog("VCB SMS Service", "No URL for web service VCBWSSoap", "VCBWSSoap", 1, EventLogEntryType.Error);
                    //}
                    //if (object.Equals(_smsService, null))
                    //{
                    //    Utilities.WriteToEventLog("VCB SMS Service", "Failed to initialise VCBWSSoap", "VCBWSSoap", 1, EventLogEntryType.Error);
                    //}
                    var svssAddrService = SVSSAdapter.GetItemsByTag("VCB_SMS");

                    var client   = ConfigurationManager.GetSection("system.serviceModel/client") as ClientSection;
                    var endpoint = client.Endpoints.Cast <ChannelEndpointElement>().FirstOrDefault(x => x.Name == "SMSWSSoap");

                    BasicHttpSecurityMode securityMode = ServiceHost.Equals("https", StringComparison.InvariantCultureIgnoreCase) ? BasicHttpSecurityMode.Transport : BasicHttpSecurityMode.None;;
                    BasicHttpBinding      binding      = new BasicHttpBinding(securityMode);
                    binding.MaxReceivedMessageSize = int.MaxValue;
                    binding.MaxBufferSize          = int.MaxValue;
                    var svssValue = svssAddrService.FirstOrDefault().Value;
                    if (string.IsNullOrEmpty(svssValue))
                    {
                        svssValue = "http://10.1.9.228:8089/SMSWS/SMSService.asmx";
                    }
                    Uri uri = new Uri(svssValue);
                    //Uri uri = new Uri("http://10.1.9.228:8089/SMSWS/SMSService.asmx");
                    //Uri uri = new Uri(endpoint.Address);
                    _smsService = new SMSWSSoapClient(binding, new EndpointAddress(uri));
                    if (object.Equals(_smsService, null))
                    {
                        Utilities.WriteToEventLog("VCB SMS Service", "Failed to initialise SMSWSSoapClient", "SMSWSSoapClient", 1, EventLogEntryType.Error);
                    }
                }
            }
            catch (Exception ex)
            {
                Utilities.WriteToEventLog("VCB SMS Service", ex, "Failed to initialise the VCBWSSoap adapter.", 1, EventLogEntryType.Error);
            }
        }