1

在 WCF 消息中,是否从肥皂信封元素开始计算 maxDepth?

例如,以下消息是否被视为 5 个级别?

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <ExecuteResponse xmlns="http://tempuri.org/">
            <ExecuteResult>
                <res>0</res>
            </ExecuteResult>
        </ExecuteResponse>
    </soap:Body>
</soap:Envelope>
4

1 回答 1

2

继续测试它。计算从包络节点为级别 1 开始。

如果将 maxDepth 设置为 7,则以下消息将引发异常。如果将 maxDepth 设置为 8,则会成功。

  <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
    <s:Header>
      <a:Action s:mustUnderstand="1">http://ws.lhotka.net/WcfDataPortal/IWcfPortal/Update</a:Action>
      <a:MessageID>urn:uuid:423cf7a3-18b7-47e8-a9f3-399e51db6b34</a:MessageID>
      <ActivityId CorrelationId="3716b91d-7552-4cba-8cfd-649ef7e1a1c3" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">c26b4ac3-3327-48ad-ac84-7dc56a241b57</ActivityId>
      <a:ReplyTo>
        <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
      </a:ReplyTo>
      <a:To s:mustUnderstand="1">http://localhost/Callisto/WcfAppServer.svc</a:To>
    </s:Header>
    <s:Body>
      <Update xmlns="http://ws.lhotka.net/WcfDataPortal">
        <request z:Id="1" z:Type="Csla.Server.Hosts.WcfChannel.UpdateRequest" z:Assembly="Csla, Version=3.8.3.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30" xmlns:b="http://schemas.datacontract.org/2004/07/Csla.Server.Hosts.WcfChannel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
          <b:_context z:Id="2" xmlns:c="http://schemas.datacontract.org/2004/07/Csla.Server">
            <c:_clientContext i:nil="true" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/Arrays"></c:_clientContext>
            <c:_clientCulture z:Id="3">en-US</c:_clientCulture>
            <c:_clientUICulture z:Ref="3" i:nil="true"></c:_clientUICulture>
            <c:_globalContext i:nil="true" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/Arrays"></c:_globalContext>
            <c:_principal z:Id="4" z:Type="System.Security.Principal.GenericPrincipal" z:Assembly="0">
              <m_identity z:Id="5" z:Type="System.Security.Principal.GenericIdentity" z:Assembly="0" xmlns="http://schemas.datacontract.org/2004/07/System.Security.Principal">
                <m_name z:Id="6"></m_name>
                <m_type z:Ref="6" i:nil="true"></m_type>
              </m_identity>
              <m_roles z:Id="7" z:Size="1" xmlns="http://schemas.datacontract.org/2004/07/System.Security.Principal" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
                <d:string z:Ref="6" i:nil="true"></d:string>
              </m_roles>
            </c:_principal>
            <c:_remotePortal>true</c:_remotePortal>
          </b:_context>
          <b:_object z:Id="8" z:Type="Callisto.Business.Commands.InitializeServerSystemSettings" z:Assembly="Callisto.Business, Version=0.0.28.0, Culture=neutral, PublicKeyToken=null">
            <_fieldManager i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/Csla.Core" xmlns:c="http://schemas.datacontract.org/2004/07/Csla.Core.FieldManager"></_fieldManager>
            <mbResult xmlns="http://schemas.datacontract.org/2004/07/Callisto.Business.Commands">false</mbResult>
          </b:_object>
        </request>
      </Update>
    </s:Body>
  </s:Envelope>
于 2013-07-05T14:40:57.137 回答