Consuming web-service using SQL CLR stored procedure not find default endpoint while debugging with VS2010

余生颓废 提交于 2019-12-12 04:22:17

问题


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:
...

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.


回答1:


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.



来源:https://stackoverflow.com/questions/12913945/consuming-web-service-using-sql-clr-stored-procedure-not-find-default-endpoint-w

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!