WebService Unable to connect to the remote server when using HTTPS connection in ASP.Net

Last Reply on Jan 02, 2014 02:34 AM By Mudassar

Posted on Jan 01, 2014 11:57 PM

I am using web service that has HTTPS,

so how to connect that URL by coding??

can anyone help me??

public string result(string uname, string pwd)
       {
            
               WebReference.CommonWSEndPointService eps = new WebReference.CommonWSEndPointService();
               string url = "https://98.115.140.12/Ciright/axis/CommonWS?wsdl";
               HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(url);
               CookieContainer mycookie = new CookieContainer();
               webrequest.CookieContainer = mycookie;
               webrequest.Method = "POST";
               webrequest.Accept = "test/xml";
               webrequest.ContentType = "text/xml; charset=utf-8";
 
               //System.Net.Sockets.Socket.ConnectAsync(System.Net.Sockets.SocketType.Seqpacket, SecurityProtocolType.Ssl3,
               webrequest.Connection = eps.m98459(uname, pwd);
                
               string connection = webrequest.Connection;
               return connection;
       }     

 

Posted on Jan 02, 2014 02:34 AM

Just press F5 to skip exception and it will display complete error details.

And make sure the web service is not blocked by some firewall since your web server does not ahve a SSL certificate antivirus might have blocked it