简体   繁体   English

WCF <readerQuotas> MAXDEPTH

[英]WCF <readerQuotas> maxDepth

In a WCF message, is maxDepth calculated beginning with the soap envelope element? 在WCF消息中,是否从肥皂包络元素开始计算maxDepth?

For example, is the following message considered 5 levels deep? 例如,以下消息是否被认为具有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>

Went ahead and tested it. 继续前进并进行测试。 The calculation starts with the envelope node being level 1. 计算从包络节点为级别1开始。

The following message throws an exception if maxDepth is set to 7. It succeeds if maxDepth is set to 8. 如果将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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM