Note that there are some explanatory texts on larger screens.

plurals
  1. POsilverlight 3: long running wcf call triggers 401.1 (access denied)
    text
    copied!<p>I have a wcf service consumed by a silverlight 3 control. The Silverlight client uses a basicHttpBindinging that is constructed at runtime from the control's initialization parameters like this: </p> <pre><code>public static T GetServiceClient&lt;T&gt;(string serviceURL) { BasicHttpBinding binding = new BasicHttpBinding(Application.Current.Host.Source.Scheme.Equals("https", StringComparison.InvariantCultureIgnoreCase) ? BasicHttpSecurityMode.Transport : BasicHttpSecurityMode.None); binding.MaxReceivedMessageSize = int.MaxValue; binding.MaxBufferSize = int.MaxValue; binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly; return (T)Activator.CreateInstance(typeof(T), new object[] { binding, new EndpointAddress(serviceURL)}); } </code></pre> <p>The Service implements windows security. Calls were returning as expected until the result set increased to several thousand rows at which time HTTP 401.1 errors were received.</p> <p>The Service's HttpBinding defines closeTime, openTimeout, receiveTimeout and sendTimeOut of 10 minutes.</p> <p>If I limit the size of the resultset the call suceeds.</p> <p>Additional Observations from Fiddler: When Method2 is modified to return a smaller resultset (and avoid the problem), control initialization consists of 4 calls:</p> <ol> <li>Service1/Method1 -- result:401</li> <li>Service1/Method1 -- result:401 (this time header includes element "Authorization: Negotiate TlRMTV..."</li> <li>Service1/Method1 -- result:200</li> <li>Service1/Method2 -- result:200 (1.25 seconds)</li> </ol> <p>When Method2 is configured to return the larger resultset we get:</p> <ol> <li>Service1/Method1 -- result:401 </li> <li>Service1/Method1 -- result:401 (this time header includes element "Authorization:Negotiate TlRMTV..."</li> <li>Service1/Method1 -- result:200</li> <li>Service1/Method2 -- result:401.1 (7.5 seconds)</li> <li>Service1/Method2 -- result:401.1 (15ms)</li> <li>Service1/Method2 -- result:401.1 (7.5 seconds)</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload