Home All Groups Group Topic Archive Search About

Problem Connecting to Servlet

Author
1 Nov 2006 3:51 PM
Arti
Hi,

I have a .Net application which has to communicate to Servlet on TomCat
Server. I am able to send the request but it throws an exception while
retrieving the response(Exception:The underlying connection was closed:
An unexpected error occurred on
a receive.)

Here is the code snippet .

-------------------------------------------------------------------------------------------------------
string uri =
"http://192.168.42.79:8080/MYLOGINPAGE/AMCWEBLOGINGATEWAY?LOGINID=abc&PASSWD=passwd12";
            HttpWebRequest request = (HttpWebRequest) WebRequest.Create(uri);

            request.CookieContainer = new CookieContainer() ;
            request.KeepAlive = false;
            request.ProtocolVersion=HttpVersion.Version10;
            request.Credentials = CredentialCache.DefaultCredentials;


            HttpWebResponse response = (HttpWebResponse) request.GetResponse();
---------------------------------------------------------------------------------------------------------------

Any comments of URL help is appreciated. Thank you.

Regards,
Art

AddThis Social Bookmark Button