如何将多个服务器端类型聚合成一个客户端类型? [英] how to converge multiple server side types into one client side type?

查看:67
本文介绍了如何将多个服务器端类型聚合成一个客户端类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



让我解释一下我的问题:我有一个共享类型让我们称它为SharedType。

然后我使用该类型示例在多个名称空间下有多个wcf服务:Service1.SharedType,Service2.SharedType ...我可以在相同的xml名称空间和名称下序列化所有这些吗?我的每个客户都有一个名称SharedType和命名空间www.datacontract.org。我注意到第一个运行的服务遇到没问题我可以在respectif客户端上使用SharedType。当我开始第二个,我不能在它的客户端上使用该类型,它告诉我类型不是预期的,我应该使用解析器...

有没有办法强制接受,我需要这样的方式。

是的我使用wcf类库而不是wcf应用程序。



谢谢:)

Hello everyone,

Let me explain my question : i have a shared type let's call it "SharedType".
Then I have multiple wcf services under multiple namespaces using that type example : Service1.SharedType , Service2.SharedType ... Can i serialize all of these under the same xml namespace and name?? each of my clients have a type of name "SharedType" and namespace "www.datacontract.org".I noticed that the first service to run encounters no problem i can use SharedType on the respectif client.When i start the second, i cannont use that type on it's client , it tells me that the type is not expected and that i should use a resolver...
Is there a way to force the acceptance, i need them this way on purpose.
And yeah i use wcf class library not wcf applications.

Thank you :)

推荐答案

您是所有服务和客户的作者?考虑将datacontracts提取到一个单独的dll中,并在所有项目中重复使用。
You are the author of all services and clients? Consider to extract the datacontracts into one seperate dll and reuse it in all projects.


这篇关于如何将多个服务器端类型聚合成一个客户端类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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