title: Bugzilla - webservice via JSON-RPC
body: <p>Here's what i have tried soo far.. </p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;bugstats.com&lt;/title&gt;
    &lt;/head&gt;
  &lt;script type="text/javascript"     src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://jquery-json.googlecode.com/files/jquery.json-    1.3.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" &gt;
  function hello(){
  var myObject = {"method":"User.login", /* is this the right method to call? */
  "params":[  { "login" :"user", /*should i include the login credentials here? */
  "password" : "pass123" , 
  "remember" : "True"} ]  };
  var enc = $.toJSON(myObject);
  
  $.ajax({"contentType":"application/json",
      "data": enc, 
      "crossDomain":"true",
      "dataType": "json", 
      "url": "https://bugzilla.company.com/bugzilla/jsonrpc.cgi", /* is this correct or should it be https://bugzilla.company.com/bugzilla/jsonrpc.cgi?method=User.login? */ 
      "type": "POST",
      success: function(){
              alert("Hallelujah");
                  console.log(arguments); 
  
               },
      error: function () {
      alert("Failed")
      }
  
     });
  }
  function parseResponse(obj){
   alert("Success")
   console.log(obj)
  }
  &lt;/script&gt;
    &lt;body&gt;
      &lt;h1&gt;bugzilla.com&lt;/h1&gt;
      &lt;input type="button" onclick="hello()" value="Click"&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Reading upon this <a href="http://www.bugzilla.org/docs/4.2/en/html/api/Bugzilla/WebService/Server/JSONRPC.html" rel="nofollow"><strong>JSONPRC</strong></a>, not getting far.</p>
  
  <p>When i click the button - make a call, to login/do anything for that matter - i get the following error - </p>
  
  <pre><code>OPTIONS https://bugzilla.company.com/bugzilla/jsonrpc.cgi 403 (Forbidden) jquery.min.js:19
  XMLHttpRequest cannot load https://bugzilla.company.com/bugzilla/jsonrpc.cgi. Origin http://172.16.229.137 is not allowed by Access-Control-Allow-Origin.
  </code></pre>
  
  <p>From my understanding, "Access-Control-Allow-Origin" is caused because of "same origin policy" problem and hence i should use "jsonp". But,Jsonp - i.e, script injection can only be done via GET request. But,if i try the same JS script with a GET request - i get the following : </p>
  
  <pre><code>code: 32610
  message: "For security reasons, you must use HTTP POST to call the 'User.login' method."
  </code></pre>
  
  <p>Confused on how to connect/login via Web services, i'm clearly doing something silly something majorly wrong here.. would be a great deal of help if anyone can help me connect and fetch the bug details.I've been at it since 8-10 days now.. :( </p>
  
  <p>FYI: </p>
  
  <ul>
  <li><p>I do not have access to the server</p></li>
  <li><p>I'm on a client setup and accessing the Bugzilla server</p></li>
  </ul>
  
  <p>Other links,</p>
  
  <p><a href="http://guy-pyrzak.blogspot.in/2009/07/bugzilla-json-rpc-webservice-with.html" rel="nofollow"><strong>Ajax Call</strong></a></p>
  
  <p><a href="http://www.bugzilla.org/docs/4.2/en/html/api/Bugzilla/WebService.html#LOGGING_IN" rel="nofollow"><strong>Loggin In</strong></a></p>
  
  <p><a href="https://wiki.mozilla.org/User%3aHarthur/BugzillaRPC" rel="nofollow"><strong>BugzillaApc</strong></a></p>
  
  <p><a href="https://groups.google.com/forum/?fromgroups#!topic/mozilla.support.bugzilla/-kNtcaggyJY" rel="nofollow"><strong>Google Groups - Live conversation</strong></a></p>