复制代码 代码如下:
public class ServiceUtil
{
public static string SVCPath { set; get; }
/// <summary>
/// Get Data Service path
/// </summary>
/// <returns>path</returns>
public static WorkflowServiceClient GetDynamicClient()
{
if (SVCPath == null)
throw new Exception("Wrong SVC Path!");
BasicHttpBinding binding = new BasicHttpBinding(Application.Current.Host.Source.Scheme.Equals("https", StringComparison.InvariantCultureIgnoreCase) ? BasicHttpSecurityMode.Transport : BasicHttpSecurityMode.None);
binding.MaxReceivedMessageSize = int.MaxValue;
binding.MaxBufferSize = int.MaxValue;
return new WorkflowServiceClient(binding, new EndpointAddress(new Uri(Application.Current.Host.Source, SVCPath)));
}
}
新闻热点
疑难解答
图片精选