简体   繁体   English

在WPF中使用共享对象进行远程方法调用?

[英]Remote method call with shared objects in WPF?

I need to do a conceptually simple thing: 我需要做一个概念上简单的事情:

Call a remote method from a WPF application to the server. 从WPF应用程序调用远程方法到服务器。 But I need to share the model types with both sides.. I mean, I need to send a Person object as parameter from the client and also receive objects of the same type. 但是我需要在双方之间共享模型类型。我的意思是,我需要从客户端发送一个Person对象作为参数,还需要接收相同类型的对象。

What's the best way? 最好的方法是什么? Is it to use WCF? 使用WCF吗? Is there a better way? 有没有更好的办法? Do you have a code snippet or simple example for that? 您是否有相应的代码段或简单示例?

I appreciate. 我很感激

The standard advice these days is to use WCF for that. 这些天的标准建议是为此使用WCF。 It has the flexibility to make the connection using any number of technologies (TCP/IP, SOAP, REST, ...) and can use declarative configuration which is all the rage. 它具有使用多种技术(TCP / IP,SOAP,REST等)进行连接的灵活性,并且可以使用非常流行的声明式配置。

Depending on your environment and the technology the server is developed in you might also want to look at .NET Remoting or an ASP.NET web service. 根据您的环境和开发服务器的技术,您可能还需要查看.NET Remoting或ASP.NET Web服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM