title: Calling Service Now Webservice with .Net
body: <p>I am trying to call Service Now's webservice from .Net and I can make it work fine for inserting a record, but I can not get any <code>GET</code>s to work. Here is my working <code>INSERT</code> code: </p>
  
  <pre><code>public void insertTable(string tableName, string schema, string columnInfo, string shortDesrcipt, string longDescript)
  {
      using (ServiceNow_u_database_table tableReference = new ServiceNow_u_database_table())
      {
          insertResponse response = new insertResponse();
  
          System.Net.ICredentials cred = new System.Net.NetworkCredential(Properties.Settings.Default.UserName, Properties.Settings.Default.Password);
          tableReference.Credentials = cred;
  
          insert tableInsert = this.getTableData(tableName, schema, columnInfo, shortDesrcipt, longDescript);
          try
          {
              response = tableReference.insert(tableInsert);
          }
          catch (Exception error)
          {
              Console.WriteLine(error.Message);
          }
      }
  }
  </code></pre>
  
  <p>That works fine. Here is the code that does not work for <code>GET</code>: </p>
  
  <pre><code>using (ServiceNow_u_database_table tableReference = new ServiceNow_u_database_table())
  {
      ServiceNowExport.com.servicenow.libertydev.u_database_table.getRecords recordGet = new getRecords();
      System.Net.ICredentials cred = new System.Net.NetworkCredential(Properties.Settings.Default.UserName, Properties.Settings.Default.Password);
      tableReference.Credentials = cred;
  
      recordGet.name = this._tablePrefix + tableName;
      getRecordsResponseGetRecordsResult[] response = tableReference.getRecords(recordGet);
      if (response != null &amp;&amp; response.Count() &gt; 0)
      {
          return true;
      }
  }
  </code></pre>
  
  <p>When I run that code, <code>response</code> is always <code>null</code>. I am following the instructions on <a href="http://wiki.service-now.com/index.php?title=Microsoft_.NET_Web_Services_Client_Examples" rel="nofollow">this</a> page.</p>
  
  <p>I know that it is connecting because if I kill the credentials line I get an unauthorized error. Any ideas what I am doing wrong here? Thanks!</p>