问题描述
更新3:
我创建了一个Visual Studio 2008测试项目,并尝试创建对共享站点WCF服务参考的服务参考,并收到以下错误:
UPDATE 3:
I created a Visual Studio 2008 test project and tried to create a service reference to shared site WCF service reference and received the following error:
更新2:
@Nick-我尝试了您的建议,即使用每个服务器的标准路径明确设置每个端点的地址,但我仍然得到相同的结果.
UPDATE 2:
@Nick - I tried your suggestion of explictly setting the address of each endpoint with the fully qualified path of each server and I still get the same result.
此外,当我尝试使用共享站点URL设置listenUri属性时,我收到400错误的请求错误,而不是404错误.
Also, when I try to set the listenUri attribute with the shared site URL, I get a 400 bad request error instead of a 404 error.
更新
经过一些额外的研究,在 http://apps1.mydomain 和 http://apps2.mydomain 并能够解决服务器应用程序不可用"错误.
UPDATE
After some additional research, there were some IIS configuration setting conflicts between http://apps1.mydomain and http://apps2.mydomain and was able to get past the "Server Application Unavailable" error.
现在,当我尝试浏览共享站点时,出现了404错误( http://apps.mydomain ),但我能够浏览到 http://apps1.mydomain 和 http://apps2.mydomain 服务参考.
Now I am getting a 404 error when I tried to browse to the shared site (http://apps.mydomain), but I am able to browse to the http://apps1.mydomain and http://apps2.mydomain service reference.
原始问题
我的公司使用 Microsoft NLB 来平衡我们之间的流量IIS服务器.我最近将WCF服务部署到了每台IIS 6 Windows Server 2003 Standard Edition SP1服务器上.当我尝试使用IE 7浏览到共享域名时收到以下错误:
My companys uses Microsoft NLB to load balance traffic between our IIS servers. I recently deployed a WCF service on to each IIS 6 Windows Server 2003 Standard Edition SP1 servers. I received the following error when I tried to browse to the shared domain name using IE 7:
管理员注意:错误消息 详细说明造成这种情况的原因 请求失败可以在 Web应用程序事件日志 服务器.请查看此日志条目 发现导致此错误的原因 发生.
Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
消费者将指向 http://apps.mydomain 来使用服务,但虚拟域已映射到 http://apps1.mydomain 或 http://apps2.mydomain .如果我浏览到每台服务器上的服务,则不会收到该错误.
The consumer will point to the http://apps.mydomain to use the service but virtual domain is mapped to http://apps1.mydomain or http://apps2.mydomain. If I browse to the service on each server, I do not receive that error.
该服务当前正在使用匿名basicHttpBinding.
The service is currently using a anonymous basicHttpBinding.
还有其他人遇到过这个问题吗?
Has anyone else experienced this issue?
历史
在开始发生此错误之前,浏览到所有三个域名时,我收到以下错误消息( http://apps.mydomain , http://apps1.mydomain , http://apps2.mydomain ):
Before this error started occurring, I received the following error when I broswed to all three domain name (http://apps.mydomain, http://apps1.mydomain, http://apps2.mydomain):
我使用了 ServiceHostFactory 类自定义我的.svc文件以指定自定义服务工厂.然后,我通过继承ServiceHostFactory并根据需要进行覆盖来创建我们的自定义工厂.
I used the ServiceHostFactory class to customize my .svc file to specify a custom service factory. Then I create our custom factory by inheriting from ServiceHostFactory and overriding as required.
public class MyFactory : ServiceHostFactory
{
protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
{
return new ServiceHost(serviceType, baseAddresses[0]);
}
}
<%@ ServiceHost Language="C#" Factory="MyFactory" Debug="true" Service="MyService" CodeBehind="~/App_Code/MyService.cs" %>
推荐答案
在为我的WCF服务和使用应用程序尝试了不同的配置之后.我创建了对其中一个工作服务引用( http://apps1.mydomain 或).然后,我将客户端配置中的终结点引用更改为指向共享站点WCF地址( http://apps.mydomain ),便可以使用和使用该服务.
After some experimenting with different configurations for my WCF service and consuming application. I created a service reference to one of the working service references (http://apps1.mydomain or http://apps2.mydomain) in the consuming application. Then I changed the endpoint reference in the client configuration to point to the shared site WCF address (http://apps.mydomain) and I was able to consume and use the service.
这篇关于WCF服务的负载平衡错误-NLB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!