0
我有一个服务,当我添加我的服务引用时,我应该只在客户端获得一个端点为什么是这样?在WCF中获得2个端点而不是预期的端点?
我做了什么来配置我的服务如下。
try
{
Uri baseAddress = new Uri("http://localhost:8080/Easicreate/SearchService");
BasicHttpBinding binding = new BasicHttpBinding();
this.host = new ServiceHost(typeof(SearchServiceContract));
this.host.AddServiceEndpoint(typeof(ISearchServiceContract), binding, "http://localhost:8080/Easicreate/SearchService");
//// Enable metadata publishing.
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
smb.HttpGetUrl = baseAddress;
smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
this.host.Description.Behaviors.Add(smb);
this.host.Open();
}
catch (Exception ex)
{
this.host = null;
}
我有点困惑吗?
你能后生成的客户端配置?我很想看看其他端点产生了什么。为了解决这个问题,我会检查WSDL(检查服务是否确实暴露了2个端点),然后以详细级别捕获WCF跟踪,并检查Construct主机活动以了解从其他端点获取的位置。 HTH,Amit – amit 2011-05-31 14:08:18