If I am not misunderstood, You want to Call your HTTP based Java Web Service(
Servlet) in Asp.Net.
This also means you are willing to call
REST based Service.
Try as below code to call REST based Service in your Asp.Net code.
string url = "YourWebServiceUrl";
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)request.GetResponse();
if (response.StatusCode == System.Net.HttpStatusCode.OK)
{
System.IO.Stream receiveStream = response.GetResponseStream();
System.IO.StreamReader readStream = null;
if (response.CharacterSet == null)
readStream = new System.IO.StreamReader(receiveStream);
else
readStream = new System.IO.StreamReader(receiveStream,
System.Text.Encoding.GetEncoding(response.CharacterSet));
string result = readStream.ReadToEnd();
response.Close();
readStream.Close();
}
Have a look at below links for more information on
REST.
https://www.ibm.com/developerworks/webservices/library/ws-restful/
http://www.infoq.com/minibooks/emag-03-2010-rest
Updated -
While calling REST Service, it also important to consider what kind of your Web-Method is - Get/Post(Not considering Put and Delete for now).
Have a look at below Article which elaborates Developing and Consuming REST Services.
Developing a REST Web Service using C# - A walkthrough
You may look at only "
Part # 6 - Testing the application" section from above article to understand, How to Call Get/Post Web-Methods of REST Service.