是否添加一个方法到WCF的ServiceContract打破现有的客户端? [英] Does adding a method to a WCF ServiceContract break existing clients?

查看:85
本文介绍了是否添加一个方法到WCF的ServiceContract打破现有的客户端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个现有的ServiceContract

We have an existing ServiceContract

[ServiceContract(Namespace = "http://somesite.com/ConversationService")]
public interface IConversationService
{
        [OperationContract(IsOneWay = true)]
        void ProcessMessage(Message message);

        [OperationContract(IsOneWay = true)]
        void ProcessMessageResult(MessageResult result);
}

,我们需要一种方法添加到它

and we need to add a method to it

[ServiceContract(Namespace = "http://somesite.com/ConversationService")]
public interface IConversationService
{
        [OperationContract(IsOneWay = true)]
        void ProcessMessage(Message message);

        [OperationContract(IsOneWay = true)]
        void ProcessMessageResult(MessageResult result);

        [OperationContract(IsOneWay = true)]
        void ProcessBlastMessage(BlastMessage blastMessage);
}

这会不会打破使用该服务的任何现有的WCF客户端?还是我们必须更新所有现有的WCF客户端?

Will this break any existing wcf clients that are using this service? Or will we have to update all existing wcf clients?

编辑:使用该服务既NetTcpBinding的和netMsmqBinding

This service is using both netTcpBinding and netMsmqBinding

推荐答案

我觉得你的现有客户将继续工作。毕竟这是非常相似的SOAP和web服务中,客户端将连接到给定的URL和请求特定的服务。如果你的方法走,你会破碎险(仅在使用该方法,我相信),但加入应该是无痛苦。

I think your existing clients will continue to work. After all this is very similar to SOAP and web services in that the client will connect to the given URL and request a specific service. If you take methods away you will risk breakage (only if the method is used I believe) but adding should be pain free.

我只涉足WCF,但以这种方式取得了巨大成功使用的ASP.NET Web服务。

I've only dabbled in WCF but have used the ASP.NET web services in this way to great success.

这篇关于是否添加一个方法到WCF的ServiceContract打破现有的客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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