You must Sign In to post a response.
  • Category: Webservices

    How to solve 500 internal server

    Hi Iam working with some api that not working properly iam getting error like 500 internal server

    how to solve this

    namespace ConsoleBonanzas
    class Program
    static void Main(string[] args)

    string response = "";

    string requesterCredentials = "\"requesterCredentials\": {\"bonanzleAuthToken\": \"mytoken\"},";
    string itemSpecifics = "\"itemSpecifics\": [[\"condition\", \"used\"], [\"danger\", \"extreme\"]],";
    string itemVariations = "\"variations\": [{\"nameValueList\": [{\"name\": \"Colour\", \"value\": \"Blue\"}, {\"name\": \"Style\", \"value\": \"Single\"}], \"quantity\": 3}, {\"nameValueList\": [{\"name\": \"Colour\", \"value\": \"Red\"}, {\"name\": \"Style\", \"value\": \"string\"}], \"quantity\": 1}],";
    string pictureDetails = "\"pictureDetails\": {\"pictureURL\": [\"\", \"\"]},";
    string itemDescription = "\"description\": \"An elegant weapon, for a more civilized age * SELLER NOT LIABLE FOR DISMEMBERMENT *\",";

    string contentToPost = "addFixedPriceItemRequest={" + requesterCredentials + "\"itemId\": 208617, \"item\": {\"shippingType\": \"Free\"," + itemDescription + "\"title\": \"Lightsaber\", \"price\": 42, \"quantity\": 3," + itemVariations + "\"primaryCategory\": {\"categoryId\": \"163128\"}}";
    response = makeRequest(contentToPost);
    Console.Write("response is" + response);

    private static string makeRequest(string contentToPost)
    string Api_url = "";
    //System.Net.WebRequest request = System.Net.WebRequest.Create(Api_url);
    HttpWebRequest request = (HttpWebRequest)System.Net.WebRequest.Create(Api_url);
    request.Headers.Add("X-BONANZLE-API-DEV-NAME", "mydevname");
    request.Headers.Add("X-BONANZLE-API-CERT-NAME", "mycername");

    // System.Net.ServicePointManager.ServerCertificateValidationCallback = new Net.Security.RemoteCertificateValidationCallback(CertificateValidationCallBack);
    System.Net.ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(CertificateValidationCallBack);

    byte[] contentBytes = System.Text.Encoding.UTF8.GetBytes(contentToPost);

    request.Method = "POST";
    request.AllowAutoRedirect = true;
    request.ContentLength = contentBytes.Length;
    System.IO.Stream requestStream = request.GetRequestStream();
    requestStream.Write(contentBytes, 0, contentBytes.Length);

    System.Net.HttpWebResponse response = (HttpWebResponse)request.GetResponse();

    Console.Write("response...." + response);
    // Read the response into a StreamReader
    System.IO.StreamReader responseReader = new System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.UTF8);
    string strResponse = responseReader.ReadToEnd();
    return strResponse;
    catch (Exception ex)
    System.Console.WriteLine("Failed to call Bonanza with content " + contentToPost + ", " + ex.Message );

    private static bool CertificateValidationCallBack(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors)
    return true;
  • #760555
    500-internal-server your service or navigate path not found so we canot reach there?

    check your service individual in the browser view browser menu

    Name : Dotnet Developer-2015
    Email Id :

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #760559

    This occurs because the server that is running IIS cannot access the configured root directory of the requested location.

    Resolution would be to make sure that the server
    that is running IIS can access the configured root
    directory of the requested location.


    Sridhar Thota.
    "Poverty means.. Poverty of knowledge.."

    Sridhar Thota.
    Editor: DNS Forum.

  • #769709
    Generally , we used to get 500 internal server error in below cases
    1. Access permission to the specific requested page
    2. Timeout during processing of request
    3. Code error internally which involves server side execution

    so, ensure above below are properly handled to resolve the above 500 internal server error.

    B.Ramana Reddy

  • Sign In to post your comments