错误ebay [CDATA][应用程序内部错误]]



我必须在android中获得SessionID ebay。我使用了xml解析器。

,代码是

static final String url = "https://api.sandbox.ebay.com/ws/api.dll";
HttpClient httpClient = new DefaultHttpClient();
final HttpParams httpParams = httpClient.getParams();
HttpConnectionParams.setConnectionTimeout(httpParams, 100000);
HttpPost httpPost = new HttpPost(url);
StringEntity se = new StringEntity("<RuName>"your runame"</RuName>",HTTP.UTF_8);
//StringEntity entity = new StringEntity(sb.toString(),"UTF-8");
httpPost.setEntity(se);
httpPost.setHeader("X-EBAY-API-COMPATIBILITY-LEVEL","673");
httpPost.setHeader("X-EBAY-API-APP-NAME", Constants.EBAY_APP_ID);
httpPost.setHeader("X-EBAY-API-DEV-NAME",Constants.EBAY_DEV_ID);
httpPost.setHeader("X-EBAY-API-CERT-NAME", Constants.EBAY_CERT_ID);
httpPost.setHeader("X-EBAY-API-SITEID","0");
httpPost.setHeader("X-EBAY-API-CALL-NAME","GetSessionID");
httpPost.setHeader("Content-Type","text/xml");
//httpPost.addHeader("Content-Length","4392");
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
xml = EntityUtils.toString(httpEntity);
Log.e("xml", xml);

但是它显示了响应,

12-22 14:52:57.327: ERROR/xml(422):
<?xml version="1.0" encoding="UTF-8" ?>
<eBay>
  <EBayTime>2012-12-22 07:52:57</EBayTime>
  <Errors>
   <Error>
   <Code>10007</Code>
   <ErrorClass>SystemError</ErrorClass>
   <SeverityCode>1</SeverityCode>
   <Severity>SeriousError</Severity>
   <Line>0</Line>
   <Column>0</Column>
   <ShortMessage><![CDATA[ Internal error to the application ]]></ShortMessage>
  </Error>
 </Errors>
</eBay>

解决方案吗?

引自http://developer.ebay.com/devzone/xml/docs/Reference/eBay/Errors/ErrorMessages.htm:

Error 10007("应用程序内部错误")表示错误在eBay服务器端,而不是应用程序中的错误。

你试过直播网站了吗?eBay的沙箱有时会有一些bug。

相关内容

最新更新