問題描述
我們開發了調用 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 服務找不到默認端點的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!