1
我在custom binding
,getting end point address from config
以下创建,然后尝试向WCF服务发送请求。与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参数名:通过“}
我正在连接到客户端共享的soap服务。如果我用'Https'使用'Transport',我是否需要在绑定(配置文件)中提及证书?或者这个证书必须由客户端在其托管此服务的IIS上安装? – simbada
证书不是只针对wcf。您需要将其安装在托管的IIS机器中。@ simbada – Rajput