title: OData request show showing up in Fiddler (SharePoint & Silverlight 5)
body: <p>I've got a Silverlight 5 app that is calling an OData service (the OOTB one incuded with SharePoint 2010) to pull data back form a list. The site is secured using Windows Authentication. When I run my test I get prompted to login but the results always say there are zero results returned in the result set.</p>
  
  <p>Now here's what's strange. I know there's data in the list (and when I manually plug in the OData request URL, I see results come back in the browser). When I watch Fiddler while running the test, I see a few requests for clientaccesspolicy.xml (all result in a 401 response)... then I login &amp; it successfully obtains the clientaccesspolicy.xml file. However, even though the app says it ran the query and got zero results back, I don't see the actual OData service request in Fiddler (nothing after the successful call to clientaccesspolicy.xml.</p>
  
  <p>Here's what the code looks like:</p>
  
  <pre><code>private DataServiceCollection&lt;InstructorsItem&gt; _dataCollection = new DataServiceCollection&lt;InstructorsItem&gt;();
  
  private Action&lt;IEnumerable&lt;Instructor&gt;&gt; _callbackWithData;
  
  /// &lt;summary&gt;
  /// Retrieves a list of instructors from the data service.
  /// &lt;/summary&gt;
  public void GetInstructors(Action&lt;IEnumerable&lt;Instructor&gt;&gt; callback) {
    // save callbacks
    ResetCallbacks();
    _callbackWithData = callback;
  
    // get the instructors
    var query = from instructor in IntranetContext.Instructors
                select instructor;
  
    // execute query
    RunQuery(query);
  }
  
  /// &lt;summary&gt;
  /// Retrieves instructors from the data source based on the specified query.
  /// &lt;/summary&gt;
  /// &lt;param name="query"&gt;Query to execute&lt;/param&gt;
  private void RunQuery(IQueryable&lt;InstructorsItem&gt; query) {
    // clear the collection &amp; register the load completed method
    _dataCollection.Clear();
    _dataCollection.LoadCompleted += OnLoadDataCompleted;
  
    // fire the load
    _dataCollection.LoadAsync(query.Take(5));
  }
  
  /// &lt;summary&gt;
  /// Handler when the data has been loaded from the service.
  /// &lt;/summary&gt;
  /// &lt;param name="sender"&gt;&lt;/param&gt;
  /// &lt;param name="e"&gt;&lt;/param&gt;
  void OnLoadDataCompleted(object sender, LoadCompletedEventArgs e) {
    // remove the event handler preventing double loads
    _dataCollection.LoadCompleted -= OnLoadDataCompleted;
  
    // convert the data to a generic list of objects
    var results = _dataCollection.ToList&lt;InstructorsItem&gt;();
  
    // TODO: convert results to local objects
    List&lt;Instructor&gt; convertedResults = new List&lt;Instructor&gt;();
    foreach (var item in results) {
      convertedResults.Add(new Instructor() { 
        SharePointId = item.Id,
        Name = item.Title
      });
    }
  
    // run the callback
    _callbackWithData(convertedResults);
  }
  </code></pre>
  
  <p>And here's what the test runner looks like that's triggering it:</p>
  
  <pre><code>[TestMethod]
  [Asynchronous]
  [Description("Test loading instructors from the OData Intranet service.")]
  public void TestGetInstructors() {
    bool asyncCallCompleted = false;
    List&lt;Instructor&gt; result = null;
  
    // call data service
    _dataService.GetInstructors(asyncResult =&gt; {
      asyncCallCompleted = true;
      result = new List&lt;Instructor&gt;(asyncResult);
    });
  
    // run test when call completed
    EnqueueConditional(() =&gt; asyncCallCompleted);
    EnqueueCallback(
      () =&gt; Assert.IsTrue(result.Count &gt; 0, "Didn't retrieve any instructors."));
    EnqueueTestComplete();
  }
  </code></pre>
  
  <p>Can't for the life of me figure out (1) why i'm not seeing the query showing up in Fiddler when it is saying there are no errors, in fact it says there are zero errors when running the test.</p>