2013-07-12 39 views
0

我想將參數傳遞給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(); 
} 
+0

_「的價值在服務其他參數都得到分配」 _ - 你說值(或值)都至少達到遠作爲服務器端的代碼? – nnnnnn

回答

0

你應該通過參數CallWcfService()

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

對不起mrida我沒有得到你 – Mayur

+0

參數正在分配給wcf服務變量,因爲我從服務 – Mayur

+0

返回strErrMsg和chrErrFlg抱歉,我沒有注意到你的變量是全局的。 – mrida

相關問題