Hi, I am calling a .NET WCF service from Ajax like this:
result = $.ajax({
type: "POST",
// async: false,
contentType: "application/json; charset=utf-8",
url: BaseUrl + "Services/YucataService.svc/SetGameStatusSecure",
data: "{'gameID':'" + gameID + "','pid':'" + pid + "','status':'" + newStatus + "','origStatus':'" + oldStatus + "'}",
dataType: "json",
timeout: 20000
});
The server part looks like this:
[OperationContract]
public void SetGameStatusSecure(int gameID, int pid, string status, string origStatus)
{
... magic stuff happens
}
It works well.
Now, I would like to call the service synchronously. The only change I do is to add "async: false". The call return with status 500 (=internal server error).
Do I have to configure the WCF service differently to allow sync calls?
Before I switched to WCF I used an .asmx service to call synchronously and I didn't have any issues.
Any ideas?