title: jQuery Cross domain asmx web service call return results but still jQuery shows it as an error
body: <p>I am calling through jQuery an AJAX enabled asmx web service hosted in a remote ASP.Net website. </p>
  
  <p>The jQuery is on a page hosted on my localhost ASP.Net website. </p>
  
  <p>The problem is that jQuery is showing an error (i.e. error callback is triggered) when the above call is made, even though when I inspect the response in Fiddler, there is no error, but the correct expected value from the web service. The correct return value is 'true' which is being returned as seen in Fiddler. <strong>I cannot figure out what I am missing in my cross-domain call.</strong></p>
  
  <p><strong>jQuery code</strong> to call Cross Domain asmx service</p>
  
  <pre><code>     var userName = 'mike';
       var password = 'abcd';
      var serviceurl = "http://www.kandoodev.com/WebService1.asmx/LoginUser";
                      $.ajax({
                          url: serviceurl,
                          type: 'GET',
                          crossDomain: true,
                          contentType: "application/json; charset=utf-8",
                          data:{ userName: userName, password:   password  },
                          dataType: "jsonp",
                          success: function (msg) {
                              alert('Cross-Domain Web service call succeeded. We will now call a protected method on the web service. ' + JSON.stringify(msg));
                                     if (msg.toString() === 'true') {
                                         alert('Valid Credentials');   
                                  }
                                  else {
                                      alert('Invalid Credentials');   
                              }
                          },
                          error: function (error) { alert('ERROR has occurred!'); alert(JSON.stringify(error)) }
                      });
  </code></pre>
  
  <p><strong>WebService1.asmx</strong></p>
  
  <pre><code>    [WebService(Namespace = "http://tempuri.org/")]
      [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
      [System.ComponentModel.ToolboxItem(false)]
      // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the 
      //following line. 
  [System.Web.Script.Services.ScriptService]
  
  public class WebService1 : System.Web.Services.WebService 
  {
   [WebMethod]
   [PrincipalPermission(SecurityAction.Assert, Unrestricted = true)]
   [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
      public bool LoginUser(string userName, string password)
       {
          bool authenticated = false;
  
          if (userName.ToLower() == "mike" &amp;&amp; password.ToLower() == "abcd")//you can instead check credentials against a users table in database 
          {
              authenticated = true;
          }
          return authenticated;
       }
  }
  </code></pre>
  
  <p>The values in error callback are as below:
  <img src="https://i.stack.imgur.com/iUMKA.png" alt="Error Callback Parameter Values"></p>
  
  <p><strong>The TextView in Fiddler of Response is as below.</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;boolean xmlns="http://tempuri.org/"&gt;true&lt;/boolean&gt;
  </code></pre>