WCF消息合同版本控制 [英] WCF message contract versioning
问题描述
我创建了一个WCF服务,并使用消息合同将数据传递给客户端。
我在消息合同中添加了一个新成员,但我没有更新客户端的服务引用。
现在根据WCF版本控制旧客户端应该可以工作,但在我的情况下,当我获得服务调用后的数据时,一些成员被填充,一些成员为空(新旧邮件合同之间通用的成员。)
我也使用transport ='Streamed'进行服务绑定。
我想知道我是否遗漏了什么。
我遇到了与数据合同相同的问题。
提前谢谢。
Hi,
I had created a WCF service and used message contract to pass data to client.
I added a new member in message contract and I did not update the service reference of the client.
Now as per WCF versioning the old client should work,but In my case when I get the data after service call,some of the members are populated and some are null(members that are common between the old and new message contract).
I am also using transport='Streamed' for the service binding.
I would like to know whether I am missing something.
I faced the same issue with data contracts.
Thanks in advance.
推荐答案
我的问题通过为新添加的成员添加值为2的DataMember属性的'Order'成员来解决
My problem is solved by adding 'Order' member of DataMember attribute with value =2 for newly added members
这篇关于WCF消息合同版本控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!