Dear All,
Can anybody tell me how to call webservice in HTML page.
I have onemethod in my webservice like
public bool Check(string S,string R)
{
if(S==R)
return true;
else
return false;
}
I want to call this method in my HTML page.
I have little bit idea that we can achieve this by using Javascript or else by JQuery. If it possible in these two ways can anybody explain this with example.
Thank you ,
Loading

SIVAPosted Apr 19, 2012, 1:25 PM
Manikavelu VelayuthamPosted Feb 24, 2012, 12:29 AM
SIVAPosted Feb 23, 2012, 7:42 AM
I am unable to get solution for this..
I have attached my files as an attachment.
Please do correction in it & tell me where i have done mistake.
Thank you,
Manikavelu VelayuthamPosted Feb 23, 2012, 7:01 AM
function CallService() {
$.ajax({
type: varType, //GET or POST or PUT or DELETE verb
url: varUrl, // Location of the service
data: varData, //Data sent to server
contentType: varContentType, // content type sent to server
dataType: varDataType, //Expected data format from server
processdata: varProcessData, //True or False
success: function(msg) {//On Successfull service call
ServiceSucceeded(msg);
},
error: ServiceFailed// When Service call fails
});
}
function ValidateLogin() {
ServiceCallID = 1;
var uid = document.getElementById("username").value;
var pwd = document.getElementById("password").value;
var dataString = "{ 'UserName' : '" + uid + "', 'Password' : '" + pwd + "'}";
varType = "POST";
varUrl = WSUrl + "/LoginJSON";
varData = dataString;
varContentType = "application/json; charset=utf-8";
varDataType = "json";
varProcessData = true;
CallService();
}
LoginJSON is the webmethod
DataString is the parameter
Above example will call the webservice through Jquery in HTML