1
稱爲當我試圖調用下面的jQuery代碼如下服務時500錯誤,任何人都可以幫助嗎?WCF服務錯誤從jQuery的
result.status = 500 result.statusText = 「System.ServiceModel.ServiceActivationException」
這裏是SVC服務:
[WebInvoke(Method = "POST",
UriTemplate = "/tools/data/SearchAll")]
public JsonArray SearchAll(string tool, JsonObject filters)
{...}
這裏是jQuery的服務調用:
//Generic function to call WCF Service
function callService() {
$.ajax({
type: type, //GET or POST or PUT or DELETE verb
url: url, // Location of the service
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);
},
error: serviceFailed// When Service call fails
});
}
function searchAll() {
var tool = "1";
var filters = '{{ "col": "thiscol", "val": "thisval" }, { "col": "thiscol2", "val": "thisval2" }, { "col": "thiscol3", "val": "thisval3"}}';
type = "POST";
url = "ToolService.svc/tools/data/SearchAll";
contentType = "application/json; charset=utf-8";
dataType = "json";
data = '{ "tool": "' + tool + '", "filters" : "' + filters + '" }',
processData = false;
method = "SearchAll";
callService();
}
500內部服務器錯誤的東西是錯誤與服務器端代碼的地方調試點和步入代碼 – 2012-04-10 18:02:24
的錯誤表明您的服務無法啓動 - 檢查你的事件查看器或任何其他日誌,你可能要看看有沒有其他信息可用。 – Tim 2012-04-10 18:03:44
它工作時,我帶走的參數,這很奇怪。有任何想法嗎? – Burt 2012-04-10 18:11:54