프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / ConvertService / ServiceBase / Markus.Service.WcfService / Helper / WcfClientHelper.cs @ 53c9637d

이력 | 보기 | 이력해설 | 다운로드 (922 Bytes)

1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using System.ServiceModel;
7
using System.ServiceModel.Description;
8
using System.Web.Services;
9
using System.ServiceModel.Channels;
10
using System.Xml;
11

    
12
namespace Markus.Service.IWcfService
13
{
14
    public static class WcfClientHelper 
15
    {
16
        public static T BasicHttpBindingClient<T>(Uri ServiceEndpointAddress)
17
        {
18
            BasicHttpBinding myBinding = new BasicHttpBinding();
19

    
20
            EndpointAddress myEndpoint = new EndpointAddress(ServiceEndpointAddress);
21

    
22
            ChannelFactory<T> myChannelFactory = new ChannelFactory<T>(myBinding, myEndpoint);
23

    
24
            T wcfClient = myChannelFactory.CreateChannel();
25
            
26
            return wcfClient;
27
        }
28

    
29
        public static void ClientClose(IClientChannel client)
30
        {
31
            client.Close();
32
        }
33
    }
34
}
클립보드 이미지 추가 (최대 크기: 500 MB)