0

I have a web API2 application which is consumed by a third party application. When the application hits my end-point, my application send oAuth credentials for authentication and gets the results from the third party application.

Recently some of the transactions are failing and when i added some logs, i saw that the error: The remote server returned an error: (410) Gone is occurring for all failed transactions. Unfortunately I am unable to reproduce this issue when I am calling my application. The following is the code that I am using. What could be the issue that is causing this error?

 public async Task<customerModel>  SendSigned(string url)
{
    customerModel customermodel = null;
    try
    {
        OAuthBase oauthBase = new OAuthBase();

        string oAuthKey = ConfigurationManager.AppSettings["oAuthKey"];
        string oAuthSecret = ConfigurationManager.AppSettings["oAuthSecret"];
        string timestamp = oauthBase.GenerateTimeStamp();
        string nonce = oauthBase.GenerateNonce();
        string normalizedUrl;
        string normalizedRequestParameters;
        string sig = HttpUtility.UrlEncode(oauthBase.GenerateSignature(
            new Uri(url), oAuthKey, oAuthSecret, string.Empty, string.Empty,
            "GET", timestamp, nonce, out normalizedUrl, out normalizedRequestParameters));
        string requestUrl = String.Format("{0}?{1}&oauth_signature={2}", normalizedUrl, normalizedRequestParameters, sig);

        HttpWebRequest request = null;
        request = (HttpWebRequest)HttpWebRequest.Create(requestUrl);
        using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
        {
           myXMLDocument = new XmlDocument();
           customermodel = GetCustomerInformation(response);
        }

        return await Task.Run(() => customermodel);
    }
    catch (Exception ex)
    {
       _logger.Error("Error in SendSigned method", ex.InnerException);
        return customermodel;
    }
}
CDspace
  • 2,639
  • 18
  • 30
  • 36
Yoda
  • 319
  • 2
  • 5
  • 20
  • We are now seeing the same thing. Only 1 user gets 410 on one of our endpoints, but it works file for all other users. Long shot, did you ever figure out what the problem was? – Erik Steinebach Aug 12 '22 at 13:15

1 Answers1

0

The explanation of 410 is The target resource is no longer available at the origin server and that this condition is likely to be permanent based on this link (similar to a 404)

I would suggest you to think about recent changes you made to your

  1. API signatures
  2. Folder restructure/reorganization of assets/resources
  3. Routing changes
  4. Rename of resources
James Poulose
  • 3,569
  • 2
  • 34
  • 39
  • This issue is happening intermittently and not all the time. So it looks like the folder structure/API signatures are the same – Yoda Jun 29 '17 at 15:56