I have a solution that uses caching to trigger some action in the business project within my solution. I would like to call a web service from this project and was going to add either a web or service reference. I can't call a web service in the front end as i can't have circular reference.
我有一个解决方案,它使用缓存在解决方案内的业务项目中触发一些操作。我想从这个项目中调用一个web服务,并将添加web或服务引用。我不能调用前端的web服务,因为我没有循环引用。
I can add the reference fine, but when i publish the front end, it has the business dll in the bin folder, but there is nothing to state what the url for the reference is. If there was a web reference in the front end, the url would be stored in the web.config. Is it being compiled into the dll?
我可以添加引用很好,但是当我发布前端时,它在bin文件夹中有业务dll,但是没有什么可以声明引用的url是什么。如果前端有web引用,url将存储在web.config中。它正在编译到dll中吗?
1 个解决方案
#1
1
If you add a reference in the business layer project, the Visual Studio wizard will place the URLs into the .config file of this project.
如果在业务层项目中添加引用,Visual Studio向导将把url放到这个项目的.config文件中。
If you then need to reference these services from your web application, you'll need to add the sections to your web.config, as this is the executing assembly.
如果需要从web应用程序中引用这些服务,则需要将这些部分添加到web中。配置,因为这是正在执行的程序集。
For WCF service references this will be a system.serviceModel section with the client endpoint definitions. For ASMX web service references (from Add Web Reference) they will be in a settings section, if you have configured the service URL behaviour to be dynamic.
对于WCF服务引用,这将是一个系统。使用客户端端点定义的serviceModel节。对于ASMX web服务引用(来自Add web Reference),如果您将服务URL行为配置为动态的,那么它们将位于settings部分。
#1
1
If you add a reference in the business layer project, the Visual Studio wizard will place the URLs into the .config file of this project.
如果在业务层项目中添加引用,Visual Studio向导将把url放到这个项目的.config文件中。
If you then need to reference these services from your web application, you'll need to add the sections to your web.config, as this is the executing assembly.
如果需要从web应用程序中引用这些服务,则需要将这些部分添加到web中。配置,因为这是正在执行的程序集。
For WCF service references this will be a system.serviceModel section with the client endpoint definitions. For ASMX web service references (from Add Web Reference) they will be in a settings section, if you have configured the service URL behaviour to be dynamic.
对于WCF服务引用,这将是一个系统。使用客户端端点定义的serviceModel节。对于ASMX web服务引用(来自Add web Reference),如果您将服务URL行为配置为动态的,那么它们将位于settings部分。