title: Passing List<Guid> as web service parameter
body: <p>I have a web method that takes in List as parameter. jQuery ajax call passes the guids fine. However, the webservice has the correct amount of items in the list, but all items are empty guid. </p>
  
  <p>Here's my method. </p>
  
  <pre><code>[WebMethod]
  public bool CheckProductsAreAvailable(string userId, List&lt;Guid&gt; lId)
  {
      // do something
  }
  </code></pre>
  
  <p>And I call the service method as:</p>
  
  <pre><code>$('#&lt;%= btnCheck.ClientID %&gt;').click(function () {
  var hdnIds = document.getElementById('&lt;%= hdnIds.ClientID %&gt;');
  var ids = hdnIds.value; // this contains comma separated guids  
  
  
  var lId = new Array();
  $.each(ids.split(','), function(){
      if(this == '')
          return;
  
      lId.push({"Guid": this});
  });
  
  var data = {"userId": '&lt;%= UserId %&gt;', "lId": lId};
  
  $.ajax({
      type: 'POST',
      url: GetProductsServiceUrl() + '/CheckProductsAreAvailable',
      data: JSON.stringify(data),
      contentType: 'application/json; charset=utf-8',
      dataType: 'json',
      success: function (response) {
          if (response.d)
              $('#pAvailability').html('All items are still available.');
          else
              $('#pAvailability').html('Not All items are currently available.');
      },
      error: function (xhr) { alert(xhr.responseText); }
  });
  
  return false;
  });
  </code></pre>
  
  <p>I checked Fiddler. The value passed is as expected. Here is one sample. </p>
  
  <blockquote>
    <p>{"userId":"XXX-XXXX-0000","lId":[{"Guid":"cf93114f-d1c9-e011-bdc3-0050568e16a0"},{"Guid":"d093114f-d1c9-e011-bdc3-0050568e16a0"}"},{"Guid":"751d7859-d1c9-e011-bdc3-0050568e16a0"},{"Guid":"761d7859-d1c9-e011-bdc3-0050568e16a0"},{"Guid":"771d7859-d1c9-e011-bdc3-0050568e16a0"},{"Guid":"781d7859-d1c9-e011-bdc3-0050568e16a0"}]}</p>
  </blockquote>
  
  <p>Debugging the web method shows correct value to userId (XXX-XXXX-0000 in this case). lId shows there are same number of ids as passed (6 in this case) but all of them are empty guid (00000000-0000-0000-0000-000000000000).</p>
  
  <p>Can anybody figure out why this is happening? Thanks.</p>