2017-06-29 7 views
0

私はサードパーティアプリケーションで使用されているWeb API2アプリケーションを持っています。アプリケーションが私のエンドポイントにヒットすると、私のアプリケーションは認証のためにoAuthクレデンシャルを送信し、サードパーティのアプリケーションから結果を取得します。 リモートサーバーからエラーが返されました。(410)すべての失敗したトランザクションに対してが発生しています。残念ながら、私は私のアプリケーションを呼び出すときにこの問題を再現することができません。以下は私が使用しているコードです。このエラーの原因となっている問題は何ですか?リモートサーバーからエラーが返されました。(410)C#でなくなった

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; 
    } 
} 

答えて

0

410の説明は、ターゲット・リソースがオリジンサーバでもはや利用可能であり、この条件が

thisリンクに基づい(404と同様)永久的である可能性が高いこと ではありません

あなたの最近の変更について考えてみることをお勧めします。

  1. APIシグネチャ
  2. 資産/リソースの
  3. フォルダの再構築/再編成が
  4. ルーティングは、リソース
+0

この問題は断続的にではなく、すべての時間が起こっているの

  • 名前の変更]を変更します。したがって、フォルダ構造/ APIの署名が同じであるように見えます – Yoda

  • 関連する問題