I have a WCF “MWManageSession” service inside my WebApplication so I don’t have any service reference. The problem is that seems to work only asynchronously instead of synchronously.
public interface IMWManageSession{
[OperationContract]
[WebInvoke(Method = "POST",
BodyStyle = WebMessageBodyStyle.WrappedRequest,
ResponseFormat = WebMessageFormat.Json)]
string SetIdSelezionato_SessionData(String[] pvalori, SessionNavigation pSN, long varpChangingAzienda);
}
I consume the wcf on a client function using
$.ajax({
type: "POST",
url: webMethod,
data: jsonText,
processData: false,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
ServiceSucceeded(msg, ptoPopup, DatixWCF, myvar);
},
error: ServiceFailed
});
function ServiceSucceeded(result, ptoPopup, DatixWCF, myvar) {
console.log("ServiceSucceeded: " + result);
}
I get execute code that I put on “OnServiceSucceed” while the wcf is steel working…
How can I make the wcf works ONLY synchronously? Thanks in advance !