Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何为负载平衡器配置WCF服务_Wcf - Fatal编程技术网

如何为负载平衡器配置WCF服务

如何为负载平衡器配置WCF服务,wcf,Wcf,如何为负载平衡器配置WCF服务并指定端点您可以尝试编写一个将负载平衡器的url用作基址的: public class CustomServiceHostFactory : ServiceHostFactory { protected override ServiceHost CreateServiceHost( Type serviceType, Uri[] baseAddresses) { Uri uri = null; if (

如何为负载平衡器配置WCF服务并指定端点

您可以尝试编写一个将负载平衡器的url用作基址的:

public class CustomServiceHostFactory : ServiceHostFactory
{
    protected override ServiceHost CreateServiceHost(
        Type serviceType, Uri[] baseAddresses)
    {
        Uri uri = null;
        if (baseAddresses.Length < 2)
        {
            uri = baseAddresses[0];
        }
        else
        {
            // TODO: You need to choose the load balancer's url here:
            uri = baseAddresses[????];
        }
        return base.CreateServiceHost(serviceType, new Uri[] { uri });
    }
}
公共类CustomServiceHostFactory:ServiceHostFactory
{
受保护的覆盖ServiceHost CreateServiceHost(
类型serviceType,Uri[]基本地址)
{
Uri=null;
if(baseAddresses.Length<2)
{
uri=基本地址[0];
}
其他的
{
//TODO:您需要在此处选择负载平衡器的url:
uri=基本地址[?];
}
返回base.CreateServiceHost(serviceType,新Uri[]{Uri});
}
}
您可以尝试编写一个将负载平衡器的url用作基址的:

public class CustomServiceHostFactory : ServiceHostFactory
{
    protected override ServiceHost CreateServiceHost(
        Type serviceType, Uri[] baseAddresses)
    {
        Uri uri = null;
        if (baseAddresses.Length < 2)
        {
            uri = baseAddresses[0];
        }
        else
        {
            // TODO: You need to choose the load balancer's url here:
            uri = baseAddresses[????];
        }
        return base.CreateServiceHost(serviceType, new Uri[] { uri });
    }
}
公共类CustomServiceHostFactory:ServiceHostFactory
{
受保护的覆盖ServiceHost CreateServiceHost(
类型serviceType,Uri[]基本地址)
{
Uri=null;
if(baseAddresses.Length<2)
{
uri=基本地址[0];
}
其他的
{
//TODO:您需要在此处选择负载平衡器的url:
uri=基本地址[?];
}
返回base.CreateServiceHost(serviceType,新Uri[]{Uri});
}
}
您是在执行“正常”负载平衡(即仅将请求转发到不同的服务器),还是在使用负载平衡器进行SSL卸载?您是在执行“正常”负载平衡(即仅将请求转发到不同的服务器),还是在使用负载平衡器进行SSL卸载?