相关疑难解决方法(0)

向WCF ServiceContract添加方法是否会破坏现有客户端?

我们有一个现有的ServiceContract

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

        [OperationContract(IsOneWay = true)]
        void ProcessMessageResult(MessageResult result);
}
Run Code Online (Sandbox Code Playgroud)

我们需要为它添加一个方法

[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);
}
Run Code Online (Sandbox Code Playgroud)

这会破坏使用此服务的任何现有wcf客户端吗?或者我们是否必须更新所有现有的wcf客户端?

编辑:此服务使用netTcpBinding和netMsmqBinding

.net c# wcf

12
推荐指数
2
解决办法
8036
查看次数

标签 统计

.net ×1

c# ×1

wcf ×1