I am working to access a Web Service(i.e. an .asmx page) from a web page (i.e. an .aspx page),I am getting this
ERROR[u]
"Process must exit before requested information can be determined."</u>
Please help me
any help will be appreciated
[u]
My code of web page</u>:
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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://10.41.37.55/newnew/Service.asmx/Hello";
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");
// 'true' specifies that it's a async call
xmlhttp.Open("get", url, true);
// Register a callback for the call
xmlhttp.onreadystatechange =
function ()
{
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">
#63728;</td>
</tr>
<tr valign="top">
<td align="left" colspan="3">
<input onclick="javascript
:callResponse();" type="button" value="START" id="EchoButton" />
</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">#63728;#63728;</span> <span id="progress2">#63728;#63728;</span>
<span id="progress3">#63728;#63728;</span> <span id="progress4">#63728;#63728;</span>
<span id="progress5">#63728;#63728;</span> <span id="progress6">#63728;#63728;</span>
<span id="progress7">#63728;#63728;</span> <span id="progress8">#63728;#63728;</span>
<span id="progress9">#63728;#63728;</span>
</div>
</td>
</tr>
</table>
</div>
<div id="divResponse"></div>
</form>
</body>
</html>
[u]AND CODE of web service</u>:
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Threading;
using System.IO;
using System.Diagnostics;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string Hello()
{
hello1();
return "hello world";
}
public void hello1()
{
int ExitCode;
ProcessStartInfo ProcessInfo;
Process Process;
ProcessInfo=newProcessStartInfo"notepad.exe" , "/C " );
ProcessInfo.CreateNoWindow = false;
ProcessInfo.UseShellExecute = false;
Process = Process.Start(ProcessInfo);
Process.WaitForExit(0);
ExitCode = Process.ExitCode;
Process.Close();
}
}
Abhinav