业务层的Web Reference或者Service Reference,发布的url在哪里?
我有一个解决方案,它使用缓存来触发我的解决方案中业务项目中的某些操作。我想从这个项目中调用一个 Web 服务,并且要添加一个 Web 或服务引用。我无法在前端调用 Web 服务,因为我无法进行循环引用。
我可以很好地添加引用,但是当我发布前端时,它的 bin 文件夹中有业务 dll,但没有任何内容说明引用的 url 是什么。如果前端有 Web 引用,则 url 将存储在 web.config 中。是否被编译成dll?
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.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果在业务层项目中添加引用,Visual Studio 向导会将 URL 放入该项目的 .config 文件中。
如果您随后需要从 Web 应用程序引用这些服务,则需要将这些部分添加到 web.config 中,因为这是执行程序集。
对于 WCF 服务引用,这将是包含客户端端点定义的 system.serviceModel 部分。对于 ASMX Web 服务引用(来自“添加 Web 引用”),如果您已将服务 URL 行为配置为动态,它们将位于设置部分。
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.
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.
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.