【发布时间】:2017-03-31 12:53:00
【问题描述】:
我的 WebApplication 中有一个 WCF“MWManageSession”服务,所以我没有任何服务引用。 问题是它似乎只能异步工作而不是同步工作。
公共接口 IMWManageSession{
[OperationContract]
[WebInvoke(Method = "POST",
BodyStyle = WebMessageBodyStyle.WrappedRequest,
ResponseFormat = WebMessageFormat.Json)]
string SetIdSelezionato_SessionData(String[] pvalori, SessionNavigation pSN, long varpChangingAzienda);
}
我在客户端函数上使用 wcf
$.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);
}
当 wcf 正在工作时,我得到了执行代码“OnServiceSucceed”……
如何使 wcf 仅同步工作? 提前致谢!
【问题讨论】:
-
它不是 WCF,它的 ajax 在这里是异步的,在这里参考 async=false stackoverflow.com/questions/133310/…
标签: asp.net .net wcf client asp.net-ajax