2016-11-10 23 views
0

多くの異なるオプションを確認した後、私は専門家に質問する時間だと思う。Ebay API GetCategorySpecifics Error 500

私はGetCategorySpecificsを使用してeBayのAPIサービス呼び出しを作るしようとしているが呼んで、私は次のようなエラーメッセージが出続ける:

The remote server returned an error: (500) Internal Server Error. 

ここに私のコードは

//Create the XML File 
public string CreateEbayXMLFile() 
{ 
     string _ebayFeatureNS = "urn:ebay:apis:eBLBaseComponents"; 
     string resultXml = ""; 
     XDocument doc = new XDocument 
     (
      new XDeclaration("1.0", "utf-8", ""), 
      new XElement(_ebayFeatureNS + "GetCategorySpecifics", 
      new XElement(_ebayFeatureNS + "CategorySpecific", true), 
      new XElement(_ebayFeatureNS + "CategoryID", "CategoryID"), 
      new XElement(_ebayFeatureNS + "FeatureID", "ItemSpecificsEnabled"), 
      new XElement(_ebayFeatureNS + "ViewAllNodes", true), 
      new XElement(_ebayFeatureNS + "DetailLevel", "ReturnAll"), 
      new XElement(_ebayFeatureNS + "CategorySpecificsFileInfo", "true"), 
      new XElement(_ebayFeatureNS + "ExcludeRelationships", "false"), 
      new XElement(_ebayFeatureNS + "IncludeConfidence", "true"), 
      new XElement(_ebayFeatureNS + "MaxNames"), 
      new XElement(_ebayFeatureNS + "OutputSelector", "UnitPriceInfo") 
      ) 
     ); 
    resultXml = doc.ToString(); 
    return resultXml; 
} 

    //Make the Service Call 
    public XmlDocument MakeTheServiceCall() 
    { 
     string localEbayXml = CreateEbayXMLFile(); 
     string _ebaySvcUrl = http://svcs.ebay.com/services/search/FindingService/v1; 

     //Authentication and service call 
     byte[] Xml_bytes = Encoding.UTF8.GetBytes(localEbayReqXml); 
       HttpWebRequest req = (HttpWebRequest)System.Net.WebRequest.Create(_ebaySvcUrl) as HttpWebRequest; 
       req.Headers.Add("X-EBAY-SOA-SECURITY-APPNAME", myAppId); 
       req.Headers.Add("X-EBAY-SOA-OPERATION-NAME", "GetCategorySpecifics"); 
       req.Headers.Add("X-EBAY-SOA-SERVICE-VERSION", "1.0.0"); 
       req.Headers.Add("X-EBAY-SOA-GLOBAL-ID", "EBAY-US"); 
       req.Method = "POST"; 
       req.ContentLength = Xml_bytes.Length; 
       req.ContentType = "text/xml"; 

       using (var requestStream = req.GetRequestStream()) 
       { 
        requestStream.Write(Xml_bytes, 0, Xml_bytes.Length); 
       } 

       XmlDocument xmlDoc = new XmlDocument(); 

       using (HttpWebResponse response = (HttpWebResponse)req.GetResponse()) 
       { 
        { 
         xmlDoc.Load(response.GetResponseStream()); 
        } 
       } 

    } 

私はエラーを受け取りましたHttpWebResponse宣言のメッセージ。 xmlDoc.Load(response.GetResponseStream())には決して到達しません。

助けてください!

答えて

0

URLをhttps://api.ebay.com/ws/api.dllに変更して問題が解決しました。だから、代わりに:

string _ebaySvcUrl = http://svcs.ebay.com/services/search/FindingService/v1; 

それは

string _ebaySvcUrl = http://svcs.ebay.com/MerchandisingService 

だ前者はそれほど上のサービスfindCompletedItemsfindItemsByKeywordsとして動作します。

https://ebaydts.com/eBayKBDetails?KBid=429

:いくつかの他のURLのリストについては

は、それらを使用する際に、下記のリンクを参照してください