Consuming web-service using SQL CLR stored procedure not find default endpoint while debugging with VS2010(在使用 VS2010 进行调试时,使用 SQL CLR 存储过程使用 Web 服务找不到默认端点)
问题描述
我们开发了调用 Web 服务方法的 SQL CLR 存储过程.我们使用VS2010来开发和调试这个项目.问题是当我们尝试启动调用存储过程的测试脚本时出现以下异常:
We develop SQL CLR stored procedure which calls methods of a web-service. We use VS2010 to develop and debug this project. The problem is the following exception when we try to start test script which calls our stored procedure:
A .NET Framework error occurred during execution of user-defined routine or aggregate
"WebServiceExample":
System.InvalidOperationException: Could not find default endpoint element that
references contract 'ServiceReference1.ExRatesSoap' 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.
System.InvalidOperationException:
...
在使用 wsdl.exe 和 sgen.exe 实用程序以及其他操作的网络中,有一些关于此问题的建议.但是我们对只使用VS2010工具、设置、选项等的解决方案感兴趣.VS2010不能从头到尾做这个馅饼似乎令人难以置信,我们认为我们做错了什么.
There are some recomendations regarding this problem in the Net which use wsdl.exe and sgen.exe utilities along with another manipulations. But we are interested in solution which utilizes only VS2010 tools, settings, options, etc. It's seemed unbeleivable that VS2010 can't cook this pie from beginning to end, we think we are doing something wrong.
推荐答案
您可能需要在配置文件中手动创建对 Web 服务的引用,例如sqlserver.exe.config 它是从 SQL Server 调用的.这些不是为 SQL CLR 自动创建的,因为它由 SQL Server 执行.
You may have to manually create the reference to the web service in a config file, e.g. sqlserver.exe.config where it is invoked from SQL Server. Those aren't created automatically for SQL CLR since it is executed by SQL Server.
这篇关于在使用 VS2010 进行调试时,使用 SQL CLR 存储过程使用 Web 服务找不到默认端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在使用 VS2010 进行调试时,使用 SQL CLR 存储过程使


基础教程推荐
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01