jeudi 13 août 2015

unable to connect to the remote server from .com domain

i have create a one web service and tested it in local machine, it working fine. So i have hosted it in .com domain. but when i call that web service, it gives me "unable to connect to the remote server". so i have also hosted it .in domain. it working fine with .in domain.

I have already tried with proxy but still same error.

my code is

 //Call Send SMS API
        string sendSMSUri = "http://ift.tt/1UGL1GH";

        //Create HTTPWebrequest
        HttpWebRequest httpWReq = (HttpWebRequest)WebRequest.Create(sendSMSUri);
        httpWReq.Proxy = new System.Net.WebProxy(sendSMSUri);
        //Prepare and Add URL Encoded data
        UTF8Encoding encoding = new UTF8Encoding();
        byte[] data = encoding.GetBytes(sbPostData.ToString());
        //Specify post method
        httpWReq.Method = "POST";
        httpWReq.ContentType = "application/x-www-form-urlencoded";
        httpWReq.ContentLength = data.Length;
        using (Stream stream = httpWReq.GetRequestStream())
        {
            stream.Write(data, 0, data.Length);
        }
        //Get the response
        HttpWebResponse response = (HttpWebResponse)httpWReq.GetResponse();
        StreamReader reader = new StreamReader(response.GetResponseStream());
        string responseString = reader.ReadToEnd();
        //Close the response
        reader.Close();
        response.Close();

can anybody help me how to resolve that issue?

Aucun commentaire:

Enregistrer un commentaire