c# - Ebay API GetCategorySpecifics Error 500 -
after checking many different options, think it's time ask questions experts :).
i'm trying make ebay api service call using getcategoryspecifics call, keep getting following error message:
the remote server returned error: (500) internal server error. here's code
//create 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 service call public xmldocument maketheservicecall() { string localebayxml = createebayxmlfile(); string _ebaysvcurl = http://svcs.ebay.com/services/search/findingservice/v1; //authentication , service call byte[] xml_bytes = encoding.utf8.getbytes(localebayreqxml); httpwebrequest req = (httpwebrequest)system.net.webrequest.create(_ebaysvcurl) 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()); } } } i received error message on httpwebresponse declaration. never reaches xmldoc.load(response.getresponsestream());
please help!
i changed url https://api.ebay.com/ws/api.dll , problem resolved. instead of:
string _ebaysvcurl = http://svcs.ebay.com/services/search/findingservice/v1; it's
string _ebaysvcurl = http://svcs.ebay.com/merchandisingservice the former 1 work services findcompleteditems, finditemsbykeywords , on.
for list of other url , when use them, see link below:
Comments
Post a Comment