This error is coming while im trying to connect to a sharepoint web service through vpn.
______________________________________________________________________________________
System.Net.WebException : Unable to connect to remote Server ---> System.net.Socket.SocketException : A connection attempt failed because the connected party did not properly respond after a period of time , or established connection failed because connected host has failed to respond 203.XXX.XXX.X71:443
at System.net.socket.Socket.DoConnect(EndPoint endPointSnapshot, SpcketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInyernal(Boolean connectSocketState state s4, Socket s6, Socket & socket, IPAdress & address, ConnectSocketState state, IAsynchResult asu=yncResult, Exception exception)
______________________________________________________________________________________
Every thing is working in my web browser i m able to get the json data in browser when pasting the url in the browser after login but by the wpf application i m unable to connect and get Data
This is the Code i have used for connecting to the Remote Server to get the jason data through Vpn. also the VPN is SSL Secure
Uri serviceUri = new Uri("https://vpn.xxxxxxxxx.com/_vti_bin/xxxxxxxxxxxx.svc/");
HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(serviceUri);
string username = "XXXXXXXXXX";
string password = "XXXXXXXXXX";
wr.Proxy = new WebProxy("XXX.XXX.XXX.XXX:443", true);
wr.Proxy.Credentials = new NetworkCredential(username, password);
wr.Method = "GET";
wr.ContentType = "application/json; charset=utf-8";
wr.Credentials = new NetworkCredential(username, password);
HttpWebResponse response = (HttpWebResponse)wr.GetResponse();
Stream r_stream = response.GetResponseStream();
StreamReader response_stream = new StreamReader(r_stream, System.Text.Encoding.GetEncoding("utf-8"));
string jSon = response_stream.ReadToEnd();
response_stream.Close();
System.Web.Script.Serialization.JavaScriptSerializer jsSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
RootObject result = jsSerializer.Deserialize<RootObject>(jSon);<pre>
So, what sould i do to fetch the data..????