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>
解決策はありますか?