0

Am new in kony. And am trying to connect webservice. Kindly check given below code.

var myhttpheaders={"Content-Type":"application/x-www-form-urlencoded"};`enter code here`

   var email = myFrm.textbox212343550452827.text;`enter code here`
   var pwd = myFrm.textbox212343550452828.text;`enter code here`

var inputParamTable =    {   "appID":"NewTestAsync",   
                          "serviceID":"User",   
                          "channel":"rc", 
                          "emailID":email, 
                          "Password":pwd,
                          httpheaders: myhttpheaders,
                          httpconfig:{timeout: 600, method: "post"} };  
try   
{   

var connHandle   = kony.net.invokeServiceAsync(//sample/middleware/MWServlet),inputParamTable, callbackfunction);

}   
catch(err)   
{   
 alert("Error"+err);   
 }  
}    

So my kony server is kony.net.invokeServiceAsync(//sample/middleware/MWServlet)throwing error like 1016 cannot connect to host.

Please any one help me for solve this issue.

Thanks&Regards,

Ramesh babu.K

1 Answer 1

0

inputParamTable, callbackfunctionFirstly, the right side of 'connHandle' statement is missing a "(".

Secondly the format for invoking a service call would be : kony.net.invokeServiceAsync (url,inputParamTable,callback,info)

You need to enter an actual URL like so :

var connHandle = kony.net.invokeServiceAsync("http://www.test.kony.com", 
                                            inputParamTable, callbackfunction);

So, Instead of //sample/middleware/MWServlet

try to give it like so :

kony.net.invokeServiceAsync("http://192.168.x.x:8080/middleware/MWServlet", inputParamTable, callbackfunction);

where you replace the 192.168.x.x:8080 with your local kony server IP.

So please check your parameters once again and try.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.