【发布时间】:2016-10-26 16:59:14
【问题描述】:
我在custom binding、getting end point address from config 下面创建,然后尝试向 WCF 服务发送请求。
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = int.MaxValue;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
var endpointAddress = "";
ClientSection clientSection = (ClientSection)ConfigurationManager.GetSection("system.serviceModel/client");
for (int i = 0; i < clientSection.Endpoints.Count; i++)
{
if (clientSection.Endpoints[i].Name == "HTTPS_Port")
endpointAddress = clientSection.Endpoints[i].Address.AbsoluteUri;
}
EndpointAddress address = new EndpointAddress(endpointAddress);
MyWCFService svc = new MyWCFService(binding, address);
我收到以下错误
提供的 URI 方案“https”无效;预期的 'http'。\r\n参数名称:通过"}
【问题讨论】:
标签: c# wcf wcf-security