2013-07-03 20 views
1

在WCF消息中,maxDepth是否是從soap envelope元素開始計算的?WCF <readerQuotas> 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> 
+0

由於[MSDN](HTTP它成​​功的異常: //msdn.microsoft.com/en-us/library/ms731325.aspx)說:「一個正整數,指定每個讀取的最大**嵌套節點**深度,默認值爲32.」,我認爲計算將在信封節點之後開始。 – Tim

+0

我以爲一樣,但看起來計算包含了包絡節點。 – gravidThoughts

回答

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> 
相關問題