コード例 #1
0
        private rs.kimtec.b2b.B2BProductService getService()
        {
            rs.kimtec.b2b.B2BProductService b2b = new rs.kimtec.b2b.B2BProductService();
            X509Certificate cert = new X509Certificate(HttpContext.Current.Server.MapPath("~/b2b_pin_servis_stkr.p12"), "0328", X509KeyStorageFlags.MachineKeySet);

            if (cert != null)
                b2b.ClientCertificates.Add(cert);

            return b2b;
        }
コード例 #2
0
        public DataSet GetProductsList(string productCode, string productType)
        {
            DataSet products = null;
            //B2BProductService.B2BProductServiceSoapClient b2b = new eshopBL.B2BProductService.B2BProductServiceSoapClient();

            //rs.kimtec.b2b.B2BProductService b2b = getService();
            //b2b.ClientCertificates[0].Reset();
            //System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate(object sender, X509Certificate certificate, X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors) { return true; };
            //b2b.B2BProductServiceSoapClient b2b = new eshopDL.b2b.B2BProductServiceSoapClient();

            rs.kimtec.b2b.B2BProductService b2b = new rs.kimtec.b2b.B2BProductService();
            //b2b.Proxy = new System.Net.WebProxy("rs.kimtec.b2b.B2BProductService", true);

            X509Certificate cert = new X509Certificate(HttpContext.Current.Server.MapPath("~/b2b_pin_servis_stkr.p12"), "0328", X509KeyStorageFlags.MachineKeySet);

            if (cert != null)
                b2b.ClientCertificates.Add(cert);
            products = b2b.GetProductsList(productCode, productType);
            //SaveToFile(products);
            //}
            return products;
        }