找不到引用BCS Model引用的合同WCF服务的默认端点元素

时间:2012-12-18 17:23:40

标签: sharepoint sharepoint-2010 sharepoint2010-bcs

我使用单个方法设置了一个WCF服务,返回一个System.IO.Stream,我的BCS模型将其引用为StreamAccessor。当我通过BCS配置文件页面显示文件时,一切正常,点击“点击此处下载”。

当我尝试使用SharePoint搜索爬网BCS应用程序时出现问题。当SharePoint爬网BCS LOB时,它会为每个文件抛出以下警告;

  

此项目包含多个部分和/或可能包含附件。并非所有这些部分   被编入索引。它们可能无效或故意跳过(例如图像)。该   索引这些部分时,远程服务器也可能没有响应。 ( 不能   找到引用契约'RH.Wcf.IEmailFilerGetService'的默认端点元素   在ServiceModel客户端配置部分中。这可能是因为没有   找到了您的应用程序的配置文件,或者因为没有端点   匹配此合同的元素可以在客户端元素中找到。 )

我确实在web.config文件中有正确的设置和绑定,用于中央管理员和主站点在其中运行的Web应用程序。

我甚至尝试在GetMessage StreamAccessor中的WCF设置中进行硬编码;

SecurityBindingElement securityElement = SecurityBindingElement.CreateUserNameOverTransportBindingElement();
HttpsTransportBindingElement httpsTransport = new HttpsTransportBindingElement();
httpsTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Ntlm;

BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Ntlm;
binding.CloseTimeout = new TimeSpan(00, 05, 00);
binding.OpenTimeout = new TimeSpan(00, 05, 00);
binding.ReceiveTimeout = new TimeSpan(00, 05, 00);
binding.SendTimeout = new TimeSpan(00, 05, 00);
binding.TextEncoding = System.Text.Encoding.UTF8;
binding.MaxReceivedMessageSize = int.MaxValue;
binding.MaxBufferSize = int.MaxValue;
binding.MessageEncoding = WSMessageEncoding.Mtom;
binding.AllowCookies = false;
binding.TransferMode = TransferMode.Buffered;
binding.BypassProxyOnLocal = true;
binding.Security.Mode = BasicHttpSecurityMode.None;
binding.ReaderQuotas.MaxArrayLength = int.MaxValue;
binding.ReaderQuotas.MaxBytesPerRead = int.MaxValue;
binding.ReaderQuotas.MaxDepth = int.MaxValue;
binding.ReaderQuotas.MaxNameTableCharCount = int.MaxValue;
binding.ReaderQuotas.MaxStringContentLength = int.MaxValue;

//binding.GetType().GetProperty("ReaderQuotas").SetValue(binding, XmlDictionaryReaderQuotas.Max, null);

EndpointAddress endPoint = new EndpointAddress("http://MYSERVER:1234/EmailFilerGetService.svc");
ChannelFactory<IEmailFilerGetServiceChannel> chan = new ChannelFactory<IEmailFilerGetServiceChannel>(binding, endPoint);

IEmailFilerGetServiceChannel wc = chan.CreateChannel();

RHEmailDownloadStreamArg arg = new RHEmailDownloadStreamArg(emailId);
RHEmailDownloadStream str = wc.GetSingleMsg(arg);

我无法弄清楚这里发生了什么,这真是太疯狂了。

我正在运行的环境;

SharePoint 2010版本14.0.6029.1000

WCF服务是.NET Framework 4.0

BCS服务根据SharePoint的要求与.NET Framework 3.5一起运行。

请帮助!

0 个答案:

没有答案