calling a java servlet from a asp.net page
Hi,
I was wondering if somebody could tell me how to call a java servlet from an asp.net page and process the value returned from the servlet.
Im working with a servlet that does exactly what I need. Basically I enter one value and it returns another.
I've tried using httpResonse, httpRequest as follows>
************************************************** ***
string getVars = "1234567";
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(string.Format("h ttp://localhost:80/demo1_res{0}",getVars));
WebReq.Method = "GET";
HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
Stream Answer = WebResp.GetResponseStream();
StreamReader _Answer = new StreamReader(Answer);
************************************************** ****
If I were to run the servlet by its self I enter a number into a text box and press submit. The submit button action is called "demo1_res".
I need a way to call the servlet passing the parameter and execute the method?
But i get this error
"System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()"
Im very new to all of this and im not really too sure how to approach the problem.
Thanks
Dub
|