How to calling webmethod by conventional javascript?

Aug 5 2019 11:28 AM
I have modified c# .net code like this.
 
1.a webmothod in some_name.asmx 
 
[WebMethod]
public string WsGetBasicPremiumStandard(
string sGACode, string sVehicleType, string sInsurePlan, string sCC, string sKilo, string sSeat,
string sMake, string sModel, string sCarAge, string sIsCombine, string sEffDate, string sExpDate,
string sMakeModelCount, string userid, string channel, string sOwnDamage, string sDeduct,
string sTypeOfDriver, string sIsAccessory, string sSpecialPlan, string sDeductPD, string YearReg,
string policyType, string sInsureType, string sGroupOfPlan, string agentCode, string MLM_MemberNO,
string sBatchType, string registerNo, string chassisNo, string planVAO, string replacePolicy,
bool PhotoFeeFlag, bool violenceFlag, bool cctvFlag, string coverageRY,string Pr)
{
 ...
 ..
I modified this method by add "string Pr" parameter.
 
2.I have called this webmethod from CallService.js as below.
 
some_name.WsGetBasicPremiumStandard(
sGACode, sVehicleType, sPackage, sCC, sKilo, sSeat, sMake, sModel, sCarAge, sIsCombine,
sEffDate, sExpDate, sMakeModelCount, userid, channel, OwnDamage, Deduct, TypeOfDriver,
sIsAccessory, sSpecialPlan, sDeductPD, sYearReg, sProductType, sInsureType, sGroupOfPlan,
agentCode, MLM_MemberNO, sBatchType, registerNo, chassisNo, planVAO, replacePolicy,
PhotoFeeFlag, violenceFlag, cctvFlag, coverageRY, "N",
onLoadSuccess, onLoadError)
 
I pass value "N" for "Pr" parameter but i get error 
 
Sys.Net.WebServiceFailedException: The server method 'WsGetBasicPremiumStandard' failed with the following error: System.InvalidOperationException-- Invalid web service call, missing value for parameter: 'Pr'. 
 
anybody help me?
 
thank forward.
Thakerng. 
 

Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (1)