【问题标题】:Will adding a MessageHeaderAttribute nullable property, like a string, break the endpoint for other consumers?添加 MessageHeaderAttribute 可为空的属性(如字符串)会破坏其他消费者的端点吗?
【发布时间】:2014-12-12 02:35:57
【问题描述】:

我想将 MessageHeaderAttribute 添加到其他端点已经在使用的 WCF 端点。添加一个可为空的属性(如字符串)会破坏其他消费者的端点吗?

具体来说,其他消费者是否需要更新服务合同?如果他们的端点定义缺少此属性,是否会中断他们的服务?

所以,有些消费者不知道 ActionType 属性已添加到合同中。这些消费者还能消费吗?

<System.Diagnostics.DebuggerStepThroughAttribute(), _
 System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0"), _
 System.ServiceModel.MessageContractAttribute(WrapperName:="UploadFileMessage", WrapperNamespace:="http://...", IsWrapped:=True)> _
Partial Public Class UploadFileMessage

    <System.ServiceModel.MessageHeaderAttribute([Namespace]:="http://...")> _
    Public DocumentId As String

    <System.ServiceModel.MessageHeaderAttribute([Namespace]:="http://....")> _
    Public ActionType As String

【问题讨论】:

    标签: c# vb.net wcf c#-4.0


    【解决方案1】:

    我能够测试并验证我可以安全地添加可为空的参数。我无法测试不可为空的参数。抱歉,我没有更多信息。

    【讨论】:

      猜你喜欢
      • 2019-03-07
      • 2012-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-25
      • 1970-01-01
      • 2018-12-27
      • 2017-12-11
      相关资源
      最近更新 更多