public static void main(String[] args) throws Exception {
// TOP服务地址,正式环境需要设置为http://gw.api.taobao.com/router/rest
String serverUrl = “http://gw.api.tbsandbox.com/router/rest”;
String appKey = “test”; // 可替换为您的沙箱环境应用的AppKey
String appSecret = “test”; // 可替换为您的沙箱环境应用的AppSecret
String sessionKey = “test”; // 必须替换为沙箱账号授权得到的真实有效SessionKey
TaobaoClient client = new DefaultTaobaoClient(serverUrl, appKey, appSecret);
ItemSellerGetRequest req = new ItemSellerGetRequest();
req.setFields("num_iid,title,nick,price,num");
req.setNumIid(123456789L);
ItemSellerGetResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
if (rsp.isSuccess()) {
System.out.println(rsp.getItem().getTitle());
}
}