I want to access and "invoke" the web service of server machine by web service of my machine, i have implemented the code as given below but it is not working. means not giving the response back .
Any help will be appreceable
Thanks in advance:
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="javascript" src="scripts/progressbar.
js"></script>
</head>
<body>
<form id="form1" method="post" runat="server">
<script type="text/javascript" language="javascript">
function callResponse()
{
var url;
url = "http://localhost/set/Service.asmx";
startProgressBar();
postRequest(url);
}
/*
Displays the progress bar and corresponding text
*/
function startProgressBar()
{
divProgressBar.style.visibility = "visible";
pMessage.style.visibility = "visible";
progress_update();
}
/*
Hides the progress bar and corresponding text
*/
function stopProgressBar()
{
divProgressBar.style.visibility = "hidden";
pMessage.style.visibility = "hidden";
progress_stop();
}
/*
Creates a XMLHTTP async-call to an ASP.NET async handler
*/
function postRequest(url)
{
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
//xmlhttp.WaitForExit(4);
// 'true' specifies that it's a async call
xmlhttp.Open("get", url, true);
// Register a callback for the call
xmlhttp.onreadystatechange =
function ()
{
if (xmlhttp.readyState == 4)
{
var response = xmlhttp.responseText;
divResponse.innerHTML += "<p>" + response + "</p>";
stopProgressBar();
}
}
// Send the actual request
xmlhttp.Send();
}
</script>
<div>
<table id="TABLE1" onclick="return TABLE1_onclick()">
<tr valign="top">
<td colspan="3">
</td>
</tr>
<tr valign="top">
<td align="left" colspan="3">
<input onclick="javascript
:callResponse();" type="button" value="START" /></td>
</tr>
<tr valign="top">
<td align="left" style="height: 46px">
<p id="pMessage" style="visibility: hidden; position: relative">
<b>Processing request...</b>
</p>
</td>
<td colspan="2" style="height: 46px">
<div id="divProgressBar" style="border-right: black 1px solid; padding-right: 2px;
border-top: black 1px solid; padding-left: 2px; font-size: 12pt; visibility: hidden;
padding-bottom: 2px; border-left: black 1px solid; width: 112px; padding-top: 2px;
border-bottom: black 1px solid; position: relative">
<span id="progress1"> </span> <span id="progress2"> </span>
<span id="progress3"> </span> <span id="progress4"> </span>
<span id="progress5"> </span> <span id="progress6"> </span>
<span id="progress7"> </span> <span id="progress8"> </span>
<span id="progress9"> </span>
</div>
</td>
</tr>
</table>
</div>
<div id="divResponse"></div>
</form>
</body>
</html>
Abhinav