title: Sonar-ws-client returning 401 error even though I can perform a search in the UI
body: <p>I have the following source code:</p>
  
  <pre><code>package com.sample.sonar.report;
  
  import org.sonar.wsclient.Host;
  import org.sonar.wsclient.Sonar;
  import org.sonar.wsclient.SonarClient;
  import org.sonar.wsclient.connectors.HttpClient4Connector;
  import org.sonar.wsclient.services.*;
  import org.sonar.wsclient.issue.*;
  import java.util.List;
  
  
  public class App {
     public static void main(String args[]) {
  
      try {
  
  
  
          String url = "http://sample.url.com:9000";
          String login = "userid";
          String password = "password";
  
  
          SonarClient client = SonarClient.create(url);
          client.builder().login(login);
          client.builder().password(password);
  
  
          IssueQuery query = IssueQuery.create();
          query.rules("S1081");
          query.languages("c");
          IssueClient issueClient = client.issueClient();
          System.out.println("About to Run query\n");
          Issues issues = issueClient.find(query);
          System.out.println("Ran query\n");
          List&lt;Issue&gt; issueList = issues.list();
  
          for (int i = 0; i &lt; issueList.size(); i++) {
             System.out.println(issueList.get(i).projectKey() + " " +
                                issueList.get(i).componentKey() + " " +
                                issueList.get(i).line() + " " +
                                issueList.get(i).ruleKey() + " " +
                                issueList.get(i).severity() + " " +
                                issueList.get(i).message());
           }
  
      } catch (Exception ex) {
        System.out.println(ex);
      }
    }
  }
  </code></pre>
  
  <p>Although I can log into Sonar and search the results I am getting the following runtime error </p>
  
  <pre><code>org.sonar.wsclient.base.HttpException: Error 401 on http://sample.url.com:9000/api/issues/search?languages=c&amp;rules=S1081
  </code></pre>
  
  <p>I believe this is a 401 error which maps to Unauthorized.  Am I missing some sort of authentication beyond what I am doing?  Thanks in advance.</p>