Beispiel #1
0
        /// <summary>
        /// 工信部实时域名备案状态查询(通过英迈思的备案系统接口)
        /// </summary>
        /// <param name="domainName"></param>
        /// <returns></returns>
        public static string IcpBeianQueryRealTime(string domainName)
        {
            var binding = new BasicHttpBinding();

            binding.MaxReceivedMessageSize = 2147483647;
            var endpoint = new EndpointAddress(AppConfigurtaionServices.GetAppSettingsString("Icp_GatewayServiceUrl"));

            var service = new GatewaySoapClient(binding, endpoint);
            var v       = service.IcpBeianQueryRealTimeAsync("eimslab", domainName);

            v.Wait();

            return(v.Result.Body.IcpBeianQueryRealTimeResult);
        }
Beispiel #2
0
 public static int SendSMS(string src, string dest, string msgbody)
 {
     try
     {
         if (listPhone.Contains(dest))
         {
             string            requestid = DateTime.Now.ToString("yyyyMMddHHmmss") + new Random().Next(0, 999999).ToString("000000");
             GatewaySoapClient client    = new GatewaySoapClient();
             return(client.SendMT(src, dest, msgbody, requestid, USER_NAME, PASSWORD));
         }
         return(-202);
     }
     catch (Exception ex)
     {
         logger.Error(ex);
         return(-101);
     }
 }
        public static int SendSMS(string phone, string content)
        {
            try
            {
                string requestid = DateTime.Now.ToString("yyyyMMddHHmmss") + new Random().Next(0, 999999).ToString("000000");

                GatewaySoapClient client = new GatewaySoapClient();

                int result = client.SendMT("VietinBank", phone, content, requestid, username, password);

                client.Close();
                // 0 success
                return((int)result);
            }
            catch (Exception ex)
            {
                log.Error(ex);
                return(-100);
            }
        }
Beispiel #4
0
 public GatewaySoapClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(GatewaySoapClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Beispiel #5
0
 public GatewaySoapClient(EndpointConfiguration endpointConfiguration) :
     base(GatewaySoapClient.GetBindingForEndpoint(endpointConfiguration), GatewaySoapClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }