我想將參數傳遞給WCF服務,並從WCF服務傳遞到存儲過程,但沒有任何內容要存儲過程..服務中其他參數的值正在分配無法將參數從jQuery傳遞到存儲過程
function CallWcfService() {
// alert("CallWcfServicexxxx");
jQuery.ajax
(
{
type: Type,
url: Url,
data: parameters,
contentType: ContentType, // content type sent to server
dataType: DataType, //Expected data format from server
cache: "false",
crossDomain: true, //Same result if i remove this line
processdata: ProcessData, //True or False
success: function (msg) {
ServiceSucceeded(msg);
},
error: ServiceFailed// When Service call fails
}
);
}
function ServiceFailed(result) {
alert('Service call failed: ' + result.status + '' + result.statusText);
Type = null; Url = null; Data = null; ContentType = null; DataType = null; ProcessData = null; parameters = null;
}
function callService() {
DataType = "json";
Type = "GET";
var par = 4;
parameters = null;
Url = "http://192.168.2.42/CWSERVERWCF/bedtypemasterService.svc/GetBedTypeList?callback=?";
parameters = "{'strErrMsg':'1'},{'chrErrFlg':'A'},{'pcompanycode':'0'},{'pdiv':'1'},{'ploc':'1'}";
// alert(parameters);
ContentType = "application/json; charset=utf-8";
ProcessData = true;
//alert("sssssasasadsds");
CallWcfService();
}
_「的價值在服務其他參數都得到分配」 _ - 你說值(或值)都至少達到遠作爲服務器端的代碼? – nnnnnn