从 SharePoint 2010 Web 部件调用自定义 WCF 应用程序
总之,
我创建了一个与数据库中的数据交互的 WCF 应用程序。我还创建了一个使用它的新视觉 Web 部件。
我还创建了一个以确切方式调用 Web 部件的 ASP.NET 应用程序。
Web 部件不工作,它收到以下消息,但 ASP.NET 应用程序可以工作。
找不到默认端点 引用合同的元素 'ServiceReference1.IService' 在 ServiceModel 客户端中 配置部分。这可能是 因为没有配置文件 为您的应用程序找到,或者因为 没有端点元素与此匹配 合同可以在客户端找到 元素。
All,
I created a WCF application that interacts with data in a database. I also created a new visual web part that consumes it.
I also created an ASP.NET application that calls the web part the exact way.
The web part does not work, it gets the following message, however the ASP.NET application does work.
Could not find default endpoint
element that references contract
'ServiceReference1.IService'
in the ServiceModel client
configuration section. This might be
because no configuration file was
found for your application, or because
no endpoint element matching this
contract could be found in the client
element.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
哈哈,很快……我找到了答案……在做其他事情之前,我想先尝试最后一件事。
我将 VisualWebPart 项目中 app.config 中的代码复制到 sharepoints web.config 文件中的区域中。
lol, that was quick... I found the answer... I had one last thing that I wanted to try first before I did anything else.
I coppied the code that was in the app.config in my VisualWebPart project into the area in the sharepoints web.config file.