title: jQuery AutoComplete (jQuery UI 1.8rc3) with ASP.NET web service
body: <p>Currently, I have this version of the autocomplete control working when returning XML from a .ashx handler. The xml looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no" ?&gt; 
  &lt;States&gt;
  &lt;State&gt;
    &lt;Code&gt;CA&lt;/Code&gt; 
    &lt;Name&gt;California&lt;/Name&gt; 
  &lt;/State&gt;
  &lt;State&gt;
    &lt;Code&gt;NC&lt;/Code&gt; 
    &lt;Name&gt;North Carolina&lt;/Name&gt; 
  &lt;/State&gt;
  &lt;State&gt;
    &lt;Code&gt;SC&lt;/Code&gt; 
    &lt;Name&gt;South Carolina&lt;/Name&gt; 
  &lt;/State&gt;
  </code></pre>
  
  <p></p>
  
  <p>The autocomplete code looks like this:</p>
  
  <pre><code>    $('.autocompleteTest').autocomplete(
      {
          source: function(request, response) {
              var list = [];
              $.ajax({
                  url: "http://commonservices.qa.kirkland.com/StateLookup.ashx",
                  dataType: "xml",
                  async: false,
                  data: request,
                  success: function(xmlResponse) {
                      list = $("State", xmlResponse).map(function() {
                          return {
                              value: $("Code", this).text(),
                              label: $("Name", this).text()
                          };
                      }).get();
                  }
              });
              response(list);
          },
          focus: function(event, ui) {
              $('.autocompleteTest').val(ui.item.label);
              return false;
          },
          select: function(event, ui) {
              $('.autocompleteTest').val(ui.item.label);
              $('.autocompleteValue').val(ui.item.value);
              return false;
          }
  
      });
  </code></pre>
  
  <p>For various reasons, I'd rather be calling an ASP.NET web service, but I can't get it to work. To change over to the service (I'm doing a local service to keep it simple), the start of the autocomplete code is:</p>
  
  <pre><code>    $('.autocompleteTest').autocomplete(
      {
          source: function(request, response) {
              var list = [];
              $.ajax({
                  url: "/Services/GeneralLookup.asmx/StateList",
                  dataType: "xml",
  </code></pre>
  
  <p>This code is on a page at the root of the site and the GeneralLookup.asmx is in a subfolder named Services. But a breakpoint in the web service never gets hit, and no autocomplete list is generated. In case it makes a difference, the XML that comes from the asmx is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; 
  &lt;string xmlns="http://www.kirkland.com/"&gt;&lt;State&gt; &lt;Code&gt;CA&lt;/Code&gt; &lt;Name&gt;California&lt;/Name&gt; &lt;/State&gt; &lt;State&gt; &lt;Code&gt;NC&lt;/Code&gt; &lt;Name&gt;North Carolina&lt;/Name&gt; &lt;/State&gt; &lt;State&gt; &lt;Code&gt;SC&lt;/Code&gt; &lt;Name&gt;South Carolina&lt;/Name&gt; &lt;/State&gt;&lt;/string&gt;
  </code></pre>
  
  <p>Functionally equivalent since I never use the name of the root node in the mapping code. I haven't seen anything in the jQuery docs about calling a .asmx service from this control, but a .ajax call is a .ajax call, right?</p>
  
  <p>I've tried various different paths to the .asmx (~/Services/), and I've even moved the service to be in the same path to eliminate these issues. No luck with either.</p>
  
  <p>Any ideas?</p>