如何在不添加服务引用的情况下使用WCF服务 [英] How to consume a WCF service without adding service references

查看:138
本文介绍了如何在不添加服务引用的情况下使用WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个系统,我有很多用于不同目的的WCF服务(可能是7或8)。有些是独立的,如发送电子邮件或短信等。然后是那些使用这些服务的人,然后又有一些人消费下一级服务然后来到消费最后一级服务的网络界面。



我有3个环境:测试,登台和testLive(这不完全是实时的,但我们必须让它像现场服务器一样工作)。



此外,系统仍处于开发阶段,因此有很多变化,当我们必须更新服务器时,每台服务器上都有很多要更新的内容。 br />


问题是当我必须将更新从测试移动到临时服务器时。首先,我必须更新邮件服务和短信服务的更改(我们称之为第一阶段,因为他们不使用任何服务)。然后我们更新第二阶段服务中第一阶段服务的服务引用(因为它们的URL随服务器而变化)。在更新第二阶段之后,我们必须对第三阶段和Web界面进行相同的操作。

这需要花费大量时间并且是非常困难的过程,因为它需要完全集中。我们每次都必须在web.configs中更改相应的URL。因此存在很多错误的可能性。



有没有办法在不添加服务引用的情况下使用WCF服务。或者我们不需要做很多事情,只需在某处更改一些URL并完成它。

任何优化此过程的方法!



我得到了这个:如何使用WCF服务而不添加服务参考或代理





但我不确定它是否会起作用我们为不同的WCF服务提供不同的.NET解决方案。请建议。





是否有任何构建自动化工具可以首先配置服务引用,即替换其他URL的现有服务引用,然后构建项目,发布它,并将发布的DLL放在给定位置。

我用Google搜索并找到NAnt,msBuild以及Bamboo ,但没有发现任何相关内容。他们当然是建立和部署,但没有关于服务参考。



非常感谢。

解决方案

阅读这篇文章。您可能在架构中做了一些更改。



如何在不添加服务引用或代理的情况下使用WCF服务 [ ^ ]


< blockquote>你好ArunRajendra,



感谢您的回复。但是这个网址表示它不适用于WebApplications,而且我们的WebApplications都是WebApplications。



谢谢


Hello all,

I have a system, where I have a lot of WCF services used for different purposes (might be 7 or 8). And some are the independent one like which sends email, or SMS etc. Then comes those who consume these services, then again there are some who consume the next level services and then comes the web interface which consume the last level services.

I have 3 environments : testing, staging and testLive (which is not exactly live, but we have to keep it working like live server).

Also, the system is still in its development phase, so there are lot of changes and when we have to update server there is lot to update on each server.

the problem is when i have to move updates from Testing to Staging server. First I have to update changes in mail service and SMS service (we call it First Phase, as they don't consume any service). Then we update the service reference of first phase services in second phase services (as their URLs changes as the servers). After updating second phase, we have to do the same for Third phase and then for the Web interface.
This takes a lot of time and is very difficult process as it demands full concentration. We have to change corresponding URLs every time in web.configs too. So there is a lot of chances of mistakes.

Is there any way to consume WCF services without adding service references. Or any way that we don't have to do a lot, just change some URL somewhere and its done.
Any way to optimize this process!

I got this : How to Use a WCF Service without Adding a Service Reference or Proxy


But I am not sure if its going to work as we have different .NET solutions for different WCF service. Please suggest.

[Edit 1:]
Is there any build automation tool which can first configure the service references i.e. replace existing service references by other URLs, then build the project, publish it, and place the published DLLs at given location.
I googled and found NAnt, msBuild and also Bamboo, but found nothing relevant. They ofcourse build and deploy, but nothing about service references.

Thanks a lot.

解决方案

Read this article. You might have do some changes in your Architecture.

How to Use a WCF Service without Adding a Service Reference or Proxy[^]


Hello ArunRajendra,

Thanks for reply. But this URL says it will not work for WebApplications and ours are all WebApplications.

Thanks


这篇关于如何在不添加服务引用的情况下使用WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆