无法将参数从jQuery传递到存储过程

时间:2013-07-12 11:15:06

标签: jquery wcf parameters

我正在尝试将参数传递给WCF服务,并从WCF服务传递到存储过程,但没有任何内容存储过程..值到服务中的其他参数正在分配

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();
}

1 个答案:

答案 0 :(得分:0)

您应该将参数传递给CallWcfService()

CallWcfService(Type,Url,parameters,...);