title: jQuery ajax fails to call WCF service
body: <p>I have a windows service running on different clients. 
  I have a web application on my server that on login page call windows service on client by Jquery ajax call.</p>
  
  <p>When service is called all work fine, I have a service log that show me all the operation that it does, but ajax call always fail! The ajax call never go in success method, but I know that service is called fine.</p>
  
  <p>There are security problems that I don't know ?</p>
  
  <p>this is jquery call :</p>
  
  <pre><code>var Type;
  var Url;
  var Data = "";
  var ContentType;
  var DataType;
  var ProcessData;
  
  Type = "GET";
  
  Url = "http://localhost:8000/printTicket_test?par=hello"; 
  alert(Url);
  ContentType = "application/json; charset=utf-8";
  DataType = "jsonp";
  ProcessData = true;
  jq.support.cors = true;
  jq.ajaxSetup({ cache: false });
  
  jq.ajax({
      url: Url, // Location of the service
      type: Type, //GET or POST or PUT or DELETE verb
      //async: false,
      data: Data, //Data sent to server
      contentType: ContentType, // content type sent to server
      dataType: DataType, //Expected data format from server
      processdata: ProcessData, //True or False
      success: function (msg) {//On Successfull service call
          // ServiceSucceeded(msg);
          alert("test");
          alert(msg);
      },
      error: function (jqXHR, textStatus, errorThrown) {
          alert("test_1" + textStatus);
          alert("test_2" + errorThrown);
          alert("test_3 " + jqXHR.responseText);
      }
      //error: ServiceFailed// When Service call fails
  });
  </code></pre>
  
  <p>this is my service :</p>
  
  <pre><code>namespace PrintService{
  
  [ServiceContract]
  public interface IHelloWorldService
  {  
  
     [OperationContract]
      [WebInvoke(Method = "GET",
      ResponseFormat = WebMessageFormat.Json)]
      string printTicket_test(string par);
  
  
      }
      [AspNetCompatibilityRequirements(RequirementsMode
      = AspNetCompatibilityRequirementsMode.Allowed)]
      public class HelloWorldService : IHelloWorldService
      {
  
          private static readonly log4net.ILog m_LogFile = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  
           public string printTicket_test(string par)
          {
              try
              {
                  System.Net.ServicePointManager.ServerCertificateValidationCallback += (se, cert, chain, sslerror) =&gt;
                  {
                      return true;
                  };
  
                  m_LogFile.Debug("printTicket_test");
                  m_LogFile.Debug("Call test PrintTicket with parameter par=" + par);
                  return par;
              }
              catch (Exception ex)
              {
                  m_LogFile.Error(ex.Message);
                  return ex.Message;
              }
  
          }
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>app.config</p>
  
  <pre><code>&lt;startup&gt;
  
  
  &lt;supportedRuntime version="v2.0.50727"/&gt;&lt;/startup&gt;
  
  &lt;system.serviceModel&gt;
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name="ServiceBehavior"&gt;
        &lt;serviceMetadata httpGetEnabled="true"/&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
    &lt;endpointBehaviors&gt;
      &lt;behavior name="EndpBehavior"&gt;
        &lt;webHttp/&gt;
      &lt;/behavior&gt;
    &lt;/endpointBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;services&gt;
    &lt;service behaviorConfiguration="ServiceBehavior" name="HelloWorldService"&gt;
      &lt;endpoint address="" binding="webHttpBinding" contract="IHelloWorldService" behaviorConfiguration="EndpBehavior"/&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>