宜昌华友原料库管理软件

32 lines
630 B

using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel.Channels;
using System.ServiceModel;
namespace SSLMS.Common
{
public class WCFHelper
{
#region Wcf·þÎñ¹¤³§
public static T Create<T>(string url)
{
EndpointAddress address = new EndpointAddress(url);
Binding binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
IChannelFactory<T> factory = binding.BuildChannelFactory<T>(new BindingParameterCollection());
return factory.CreateChannel(address);
}
#endregion
}
}