프로젝트

일반

사용자정보

개정판 dfb95d0f

IDdfb95d0fb0fccd3111fe9e7c74b6fb757e6136bd
상위 bbccdd30
하위 d2bf89eb, 244b11c4

김동진이(가) 5년 이상 전에 추가함

issue #1023 kcom_api 에서 사용자 서명을 가져올때 Ensemble 에 있는 서명인지 확인하는 로직 추가

Change-Id: I0d2da3401821c461d962a518ff9972cbb1781d06

차이점 보기:

KCOM_API/ServiceDeepView.svc.cs
7 7
using System.Collections.Generic;
8 8
using System.Collections.ObjectModel;
9 9
using System.Linq;
10
using System.Net;
10 11
using System.Runtime.Remoting.Channels.Tcp;
11 12
using System.Runtime.Serialization;
12 13
using System.ServiceModel;
13 14
using System.ServiceModel.Activation;
14 15
using System.Text;
15 16
using System.Windows;
17
using System.Xml;
16 18

  
17 19
namespace KCOM_API
18 20
{
......
2286 2288
            string result = null;
2287 2289
            try
2288 2290
            {
2289
                var ModelWFConnectionString = ConnectStringBuilder.ProjectCIConnectString(project_no).ToString();
2290
                if (null != ModelWFConnectionString)
2291
                string ifsign = getEnsembleSign(user_id);
2292
                if (string.IsNullOrEmpty(ifsign))
2291 2293
                {
2292
                    using (CIEntities entity = new CIEntities(ModelWFConnectionString))
2294
                    var ModelWFConnectionString = ConnectStringBuilder.ProjectCIConnectString(project_no).ToString();
2295
                    if (null != ModelWFConnectionString)
2293 2296
                    {
2294
                        var _sign = entity.SIGN_INFO.Where(sin => sin.MEMBER_USER_ID == user_id);
2295
                        if (_sign.Count() > 0)
2297
                        using (CIEntities entity = new CIEntities(ModelWFConnectionString))
2296 2298
                        {
2297
                            result = _sign.First().SIGN_STR;                            
2298
                        }
2299
                        else
2300
                        {
2301
                            return null;
2299
                            var _sign = entity.SIGN_INFO.Where(sin => sin.MEMBER_USER_ID == user_id);
2300
                            if (_sign.Count() > 0)
2301
                            {
2302
                                result = _sign.First().SIGN_STR;
2303
                            }
2304
                            else
2305
                            {
2306
                                return null;
2307
                            }
2302 2308
                        }
2303 2309
                    }
2304 2310
                }
2311
                else
2312
                {
2313
                    result = ifsign;
2314
                }
2315

  
2305 2316
            }
2306 2317
            catch (Exception)
2307 2318
            {
......
2473 2484
            }
2474 2485
            return result;
2475 2486
        }
2487

  
2488

  
2489
        #region Legacy System I/F
2490
        /// <summary>
2491
        /// Ensemble+ Sign Data Return
2492
        /// </summary>
2493
        /// <param name="user_id"></param>
2494
        /// <returns></returns>
2495
        private string getEnsembleSign(string user_id)
2496
        {
2497
            string result = string.Empty;
2498
            string soapurl = string.Empty;
2499
            try
2500
            {
2501
                using (KCOMEntities Entity = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString()))
2502
                {
2503
                    var item = Entity.PROPERTIES.Where(d => d.TYPE == "UpLoadServiceUrl").FirstOrDefault();
2504
                    soapurl = item.VALUE;
2505
                }
2506
                WebClient webClient = new WebClient();
2507
                string data = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ens=\"http://EnsemblePlus.Webservice\"> <soapenv:Header/> <soapenv:Body> <ens:checkoutSignImage>"
2508
                    + "<ens:sUserNo>" + user_id + "</ens:sUserNo>"
2509
                    + "</ens:checkoutSignImage> </soapenv:Body></soapenv:Envelope>";
2510
                webClient.Headers.Add(HttpRequestHeader.ContentType, "text/xml");
2511
                webClient.Headers.Add("SOAPAction", "http://EnsemblePlus.Webservice");
2512
                var _result = webClient.UploadString(new Uri(soapurl), data);
2513
                XmlDocument xmlDoc = new XmlDocument();
2514
                xmlDoc.LoadXml(_result);
2515
                XmlNodeList list = xmlDoc.GetElementsByTagName("checkoutSignImageResponse");
2516
                foreach (XmlNode xn in list)
2517
                {
2518
                    result = xn["checkoutSignImageReturn"].InnerText;
2519
                }
2520
                if (!result.Contains("No business object"))
2521
                {
2522
                    return result;
2523
                }
2524
                else
2525
                {
2526
                    return null;
2527
                }
2528
            }
2529
            catch (Exception ex)
2530
            {
2531
                return null;
2532
            }
2533

  
2534

  
2535
        }
2536
        #endregion
2476 2537
    }
2477 2538
}

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)