You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
630 B
33 lines
630 B
1 month ago
|
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
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|