在应用程序之间和计算机之间编码WCF的差异 [英] Differences to code WCF between applications and between computers

查看:51
本文介绍了在应用程序之间和计算机之间编码WCF的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将开始编写一个系统,该系统将使用WCF从中央服务器发送和接收来自不同计算机和网络上的许多客户端的数据。我有编写在同一台计算机上的程序之间但不在不同计算机上的程序之间使用WCF的应用程序的经验。如果有的话,编写与单独的应用程序通信但在同一台计算机上的服务和编写与完全不同的网络上不同计算机上的应用程序通信的服务之间的区别是什么?此外,双工服务是否最适合这种情况,客户端将包含代码的字符串发送到服务器,然后由服务器解码,然后将相关数据(由代码标识)发送回客户端?谢谢。

I am about to start writing a system that will use WCF to send and receive data from a central server from lots of clients on separate computers and networks. I have had experience in writing applications that use WCF between programs on the same computer but not between programs on different computers. If any, what are the differences between writing services that communicate with separate applications but on the same computer and writing services that communicate with applications that are on separate computers on entirely different networks? Also, would a duplex service be best for this, where the client sends a string containing a code to the server which gets decoded by the server which then sends the relevant data (identified by the code) back to the client? Thank you.

推荐答案

您只需要在某个服务器上托管 WCF 服务并获取其URL。

使用该URL,您可以将服务参考添加到您的项目中,并通过服务方法与其进行通信。



当您询问差异时在 WCF 与客户端在同一台机器上和 WCF 在不同的机器上,我会说没有任何区别。因为 WCF 服务具有运行它的端点地址。



因此,无论您托管该服务,该端点都会相应地有所不同。否则将没有任何区别。
You just need to host the WCF Service on some server and get its URL.
Using that URL, you can add Service Reference to your Project and communicate with it by Service Methods.

As you are asking about difference between WCF on same machine as the client and WCF on different machine, I would say that there is no difference at all. Because WCF Service has a endpoint address on which it operates.

So, wherever you host that Service, that endpoint will differ accordingly. Otherwise there won't be any difference.


这篇关于在应用程序之间和计算机之间编码WCF的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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