프로젝트

일반

사용자정보

개정판 8cec2027

ID8cec2027dccb2db3cf26fa5008e9ee1938ee672b
상위 7f669d88
하위 5e98001b

백흠경이(가) 7달 전에 추가함

Fix: Binding 관련 코드 수정

Change-Id: I26a9ab0f5bdd4322c0c0e79f21e822f9a6be094d

차이점 보기:

KCOM/App.xaml.cs
186 186
                #endregion
187 187

  
188 188

  
189
                if (e.Args.Count() > 0)
189
                if (e.Args.Any())
190 190
                {
191 191
                    var result = ParamDecoding(e.Args[0].Replace(@"kcom://", "").Replace(@"/", ""));
192

  
193 192
#if DEBUG
194 193
                    /*
195 194
                    ViewerDataModel.Instance.IsDocumentHistory = true;
......
251 250
                    }
252 251
                }
253 252

  
254
                //App.ViewInfo.CreateFinalPDFPermission = false;
255
                //App.ViewInfo.NewCommentPermission = false;
256
                //GetQueryStringParameters();
257
                //_binding = new WSHttpBinding();
258
                //_binding.Security = new WSHttpSecurity { Transport = new HttpTransportSecurity { ClientCredentialType = HttpClientCredentialType.None }, Mode = SecurityMode.Transport };
259
                //_binding.MaxReceivedMessageSize = 2147483647;
260
                //_binding.OpenTimeout = new TimeSpan(0, 1, 0);
261
                //_binding.ReceiveTimeout = new TimeSpan(0, 10, 0);
262
                //_binding.CloseTimeout = new TimeSpan(0, 5, 0);
263
                //_binding.SendTimeout = new TimeSpan(0, 5, 0);
264
#if BASIC_BINDING
265

  
266
                #region 기본 binding
267
                BasicHttpBinding basicHttpBinding = new BasicHttpBinding(BasicHttpSecurityMode.None);
268
                basicHttpBinding.Security = new BasicHttpSecurity { Transport = new HttpTransportSecurity { ClientCredentialType = HttpClientCredentialType.None, ProxyCredentialType = HttpProxyCredentialType.None }, Mode = BasicHttpSecurityMode.None, Message = new BasicHttpMessageSecurity { AlgorithmSuite = System.ServiceModel.Security.SecurityAlgorithmSuite.Basic256, ClientCredentialType = BasicHttpMessageCredentialType.UserName } };
269
                basicHttpBinding.MaxBufferSize = 2147483647;
270
                basicHttpBinding.MaxBufferPoolSize = 2147483647;
271
                basicHttpBinding.MaxReceivedMessageSize = 2147483647;
272
                basicHttpBinding.OpenTimeout = new TimeSpan(4, 30, 0);
273
                basicHttpBinding.ReceiveTimeout = new TimeSpan(4, 30, 0);
274
                basicHttpBinding.CloseTimeout = new TimeSpan(4, 30, 0);
275
                basicHttpBinding.SendTimeout = new TimeSpan(4, 30, 0);
276
                basicHttpBinding.TextEncoding = System.Text.Encoding.UTF8;
277
                basicHttpBinding.TransferMode = TransferMode.Buffered;
278
                basicHttpBinding.MessageEncoding = WSMessageEncoding.Text;
279
                basicHttpBinding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
280

  
281

  
282
                //System.ServiceModel.Channels.ReliableSessionBindingElement reliableSession = new System.ServiceModel.Channels.ReliableSessionBindingElement();
283
                //reliableSession.Ordered = true;
284
                //reliableSession.MaxRetryCount = 3;
285
                //basicHttpBinding.CreateBindingElements().Add(reliableSession);
286
                //basicHttpBinding.ProxyAddress = null;
287
                //basicHttpBinding.AllowCookies = false;
288
                //basicHttpBinding.BypassProxyOnLocal = false;
289
                //basicHttpBinding.UseDefaultWebProxy = false;
290
                //basicHttpBinding.ProxyAddress = new Uri("Http://localhost:8888");
291

  
292
                _binding = basicHttpBinding;
293

  
294
                //System.ServiceModel.Channels.ReliableSessionBindingElement reliableSession = new System.ServiceModel.Channels.ReliableSessionBindingElement();
295
                //reliableSession.Ordered = true;
296

  
297
                //System.ServiceModel.Channels.HttpTransportBindingElement httpTransport = new System.ServiceModel.Channels.HttpTransportBindingElement();
298
                //httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous;
299
                //httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
300
                //System.ServiceModel.Channels.CustomBinding binding = new System.ServiceModel.Channels.CustomBinding(reliableSession, httpTransport);
301
                #endregion
302
#elif _CUSTOM_BINDING
303
                #region custombinding
304
                var customBinding = new System.ServiceModel.Channels.CustomBinding()
305
                {
306
                    OpenTimeout = new TimeSpan(0, 30, 0),
307
                    ReceiveTimeout = new TimeSpan(0, 30, 0),
308
                    CloseTimeout = new TimeSpan(0, 30, 0),
309
                    SendTimeout = new TimeSpan(0, 30, 0),
310
                };
311

  
312
                //var messageEncoding = new WcfExtensions.ServiceModel.Channels.CompressionBindingElement();
313
                //messageEncoding.Level = WcfExtensions.ServiceModel.Channels.CompressionLevel.Maximum;
314

  
315
                var httpTranport = new System.ServiceModel.Channels.HttpsTransportBindingElement
316
                {
317
                    MaxBufferPoolSize = Int32.MaxValue,
318
                    MaxBufferSize = Int32.MaxValue,
319
                    MaxReceivedMessageSize = Int32.MaxValue,
320
                    RequestInitializationTimeout = new TimeSpan(0, 30, 0),
321
                    //UseDefaultWebProxy = false,
322
                    //ProxyAddress = new Uri("Http://127.0.0.1:8888")
323
                };
324

  
325
                customBinding.CreateBindingElements();
326
                //customBinding.Elements.Add(messageEncoding);
327
                customBinding.Elements.Add(httpTranport);
328
           
329

  
330
                _binding = customBinding;
331
                #endregion
332

  
333
#elif CUSTOM_BINDING
334
                #region custombinding
335
                var customBinding = new System.ServiceModel.Channels.CustomBinding()
336
                {
337
                    OpenTimeout = new TimeSpan(0, 30, 0),
338
                    ReceiveTimeout = new TimeSpan(0, 30, 0),
339
                    CloseTimeout = new TimeSpan(0, 30, 0),
340
                    SendTimeout = new TimeSpan(0, 30, 0),
341
                };
342

  
343
                //var messageEncoding = new WcfExtensions.ServiceModel.Channels.CompressionBindingElement();
344
                //messageEncoding.Level = WcfExtensions.ServiceModel.Channels.CompressionLevel.Maximum;
253
                BaseAddress = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", isExternal);
254
                _EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", BaseAddress));
345 255

  
346
                var httpTranport = new System.ServiceModel.Channels.HttpsTransportBindingElement
256
                if (_EndPoint.Uri.Scheme == Uri.UriSchemeHttps)
347 257
                {
348
                    MaxBufferPoolSize = Int32.MaxValue,
349
                    MaxBufferSize = Int32.MaxValue,
350
                    MaxReceivedMessageSize = Int32.MaxValue,
351
                    RequestInitializationTimeout = new TimeSpan(0, 30, 0),
352
                    //UseDefaultWebProxy = false,
353
                    //ProxyAddress = new Uri("Http://127.0.0.1:8888")
354
                };
258
                    #region custombinding
259
                    var customBinding = new System.ServiceModel.Channels.CustomBinding()
260
                    {
261
                        OpenTimeout = new TimeSpan(0, 30, 0),
262
                        ReceiveTimeout = new TimeSpan(0, 30, 0),
263
                        CloseTimeout = new TimeSpan(0, 30, 0),
264
                        SendTimeout = new TimeSpan(0, 30, 0),
265
                    };
355 266

  
356
                customBinding.CreateBindingElements();
267
                    //var messageEncoding = new WcfExtensions.ServiceModel.Channels.CompressionBindingElement();
268
                    //messageEncoding.Level = WcfExtensions.ServiceModel.Channels.CompressionLevel.Maximum;
357 269

  
358
                var reliableSession = new System.ServiceModel.Channels.ReliableSessionBindingElement();
359
                
360
                var encoding = new System.ServiceModel.Channels.TextMessageEncodingBindingElement
361
                {
362
                    MaxReadPoolSize = Int32.MaxValue,
363
                    MaxWritePoolSize = Int32.MaxValue,
364
                    MessageVersion = System.ServiceModel.Channels.MessageVersion.Soap12WSAddressing10,
365
                    WriteEncoding = System.Text.Encoding.UTF8,
366
                    ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas
270
                    var httpTranport = new System.ServiceModel.Channels.HttpsTransportBindingElement
367 271
                    {
368
                        MaxArrayLength = Int32.MaxValue,
369
                        MaxBytesPerRead = Int32.MaxValue,
370
                        MaxDepth = Int32.MaxValue,
371
                        MaxNameTableCharCount = Int32.MaxValue,
372
                        MaxStringContentLength = Int32.MaxValue
373
                    }
374
                };
375
                //reliableSession.Ordered = true; // Set other properties as needed
376
                customBinding.Elements.Add(reliableSession);
377
                //customBinding.Elements.Add(messageEncoding);
378
                //customBinding.Elements.Add(encoding);
379
                customBinding.Elements.Add(httpTranport);
380

  
381
                _binding = customBinding;
382
                #endregion
272
                        MaxBufferPoolSize = Int32.MaxValue,
273
                        MaxBufferSize = Int32.MaxValue,
274
                        MaxReceivedMessageSize = Int32.MaxValue,
275
                        RequestInitializationTimeout = new TimeSpan(0, 30, 0),
276
                        //UseDefaultWebProxy = false,
277
                        //ProxyAddress = new Uri("Http://127.0.0.1:8888")
278
                    };
383 279

  
384
#else
385

  
386
                #region 기본 binding
387
                //BasicHttpBinding basicHttpBinding = new BasicHttpBinding(BasicHttpSecurityMode.None);
388
                //basicHttpBinding.Security = new BasicHttpSecurity { Transport = new HttpTransportSecurity { ClientCredentialType = HttpClientCredentialType.None, ProxyCredentialType = HttpProxyCredentialType.None }, Mode = BasicHttpSecurityMode.None, Message = new BasicHttpMessageSecurity { AlgorithmSuite = System.ServiceModel.Security.SecurityAlgorithmSuite.Basic256, ClientCredentialType = BasicHttpMessageCredentialType.UserName } };
389
                //basicHttpBinding.MaxBufferSize = 2147483647;
390
                //basicHttpBinding.MaxBufferPoolSize = 2147483647;
391
                //basicHttpBinding.MaxReceivedMessageSize = 2147483647;
392
                //basicHttpBinding.OpenTimeout = new TimeSpan(4, 30, 0);
393
                //basicHttpBinding.ReceiveTimeout = new TimeSpan(4, 30, 0);
394
                //basicHttpBinding.CloseTimeout = new TimeSpan(4, 30, 0);
395
                //basicHttpBinding.SendTimeout = new TimeSpan(4, 30, 0);
396
                //basicHttpBinding.TextEncoding = System.Text.Encoding.UTF8;
397
                //basicHttpBinding.TransferMode = TransferMode.Buffered;
398
                //basicHttpBinding.MessageEncoding = WSMessageEncoding.Text;
399
                //basicHttpBinding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
400

  
401

  
402
                //System.ServiceModel.Channels.ReliableSessionBindingElement reliableSession = new System.ServiceModel.Channels.ReliableSessionBindingElement();
403
                //reliableSession.Ordered = true;
404
                //reliableSession.MaxRetryCount = 3;
405
                //basicHttpBinding.CreateBindingElements().Add(reliableSession);
406

  
407
                //_binding = basicHttpBinding;
408
                #endregion
409
#endif
280
                    customBinding.CreateBindingElements();
410 281

  
411
                //Support.SetLicense();
282
                    var reliableSession = new System.ServiceModel.Channels.ReliableSessionBindingElement();
412 283

  
413
#if DEBUG
414
                //sBaseServiceURL = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", isExternal);
415
                System.Diagnostics.Debug.WriteLine("BaseServiceURL");
416
                BaseAddress = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", isExternal);
417
#else
418
                BaseAddress = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", isExternal);
419
#endif
284
                    var encoding = new System.ServiceModel.Channels.TextMessageEncodingBindingElement
285
                    {
286
                        MaxReadPoolSize = Int32.MaxValue,
287
                        MaxWritePoolSize = Int32.MaxValue,
288
                        MessageVersion = System.ServiceModel.Channels.MessageVersion.Soap12WSAddressing10,
289
                        WriteEncoding = System.Text.Encoding.UTF8,
290
                        ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas
291
                        {
292
                            MaxArrayLength = Int32.MaxValue,
293
                            MaxBytesPerRead = Int32.MaxValue,
294
                            MaxDepth = Int32.MaxValue,
295
                            MaxNameTableCharCount = Int32.MaxValue,
296
                            MaxStringContentLength = Int32.MaxValue
297
                        }
298
                    };
299
                    //reliableSession.Ordered = true; // Set other properties as needed
300
                    customBinding.Elements.Add(reliableSession);
301
                    //customBinding.Elements.Add(messageEncoding);
302
                    //customBinding.Elements.Add(encoding);
303
                    customBinding.Elements.Add(httpTranport);
304

  
305
                    _binding = customBinding;
306
                    #endregion
307
                }
308
                else
309
                {
310
                    #region 기본 binding
311
                    BasicHttpBinding basicHttpBinding = new BasicHttpBinding(BasicHttpSecurityMode.None);
312
                    basicHttpBinding.Security = new BasicHttpSecurity { Transport = new HttpTransportSecurity { ClientCredentialType = HttpClientCredentialType.None, ProxyCredentialType = HttpProxyCredentialType.None }, Mode = BasicHttpSecurityMode.None, Message = new BasicHttpMessageSecurity { AlgorithmSuite = System.ServiceModel.Security.SecurityAlgorithmSuite.Basic256, ClientCredentialType = BasicHttpMessageCredentialType.UserName } };
313
                    basicHttpBinding.MaxBufferSize = 2147483647;
314
                    basicHttpBinding.MaxBufferPoolSize = 2147483647;
315
                    basicHttpBinding.MaxReceivedMessageSize = 2147483647;
316
                    basicHttpBinding.OpenTimeout = new TimeSpan(4, 30, 0);
317
                    basicHttpBinding.ReceiveTimeout = new TimeSpan(4, 30, 0);
318
                    basicHttpBinding.CloseTimeout = new TimeSpan(4, 30, 0);
319
                    basicHttpBinding.SendTimeout = new TimeSpan(4, 30, 0);
320
                    basicHttpBinding.TextEncoding = System.Text.Encoding.UTF8;
321
                    basicHttpBinding.TransferMode = TransferMode.Buffered;
322
                    basicHttpBinding.MessageEncoding = WSMessageEncoding.Text;
323
                    basicHttpBinding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
324

  
325

  
326
                    //System.ServiceModel.Channels.ReliableSessionBindingElement reliableSession = new System.ServiceModel.Channels.ReliableSessionBindingElement();
327
                    //reliableSession.Ordered = true;
328
                    //reliableSession.MaxRetryCount = 3;
329
                    //basicHttpBinding.CreateBindingElements().Add(reliableSession);
330
                    //basicHttpBinding.ProxyAddress = null;
331
                    //basicHttpBinding.AllowCookies = false;
332
                    //basicHttpBinding.BypassProxyOnLocal = false;
333
                    //basicHttpBinding.UseDefaultWebProxy = false;
334
                    //basicHttpBinding.ProxyAddress = new Uri("Http://localhost:8888");
335

  
336
                    _binding = basicHttpBinding;
337

  
338
                    //System.ServiceModel.Channels.ReliableSessionBindingElement reliableSession = new System.ServiceModel.Channels.ReliableSessionBindingElement();
339
                    //reliableSession.Ordered = true;
340

  
341
                    //System.ServiceModel.Channels.HttpTransportBindingElement httpTransport = new System.ServiceModel.Channels.HttpTransportBindingElement();
342
                    //httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous;
343
                    //httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
344
                    //System.ServiceModel.Channels.CustomBinding binding = new System.ServiceModel.Channels.CustomBinding(reliableSession, httpTransport);
345
                    #endregion
346
                }
420 347

  
421 348
                if (isAuthenticate)
422 349
                {
......
435 362

  
436 363
                    FileUploadUri = uploadUri.ToString();
437 364
                }
438
#if BASIC_BINDING
439
                _EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", BaseAddress));
440
#elif CUSTOM_BINDING
441
                _EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", BaseAddress));
442

  
443
#else
444
                _EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", BaseAddress));
445
#endif
446 365

  
447 366
                App.FileLogger.Debug(_EndPoint.Uri);
448 367

  

내보내기 Unified diff

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