Java GetOrders API调用未返回Ebay沙盒帐户上的订单
我已经在sandbox Ebay帐户中下了测试订单,但我无法从GetOrder call获得订单详细信息。我收到了成功消息,但没有收到订单。有人能帮我吗 这是我的代码:Java GetOrders API调用未返回Ebay沙盒帐户上的订单,java,ebay-api,Java,Ebay Api,我已经在sandbox Ebay帐户中下了测试订单,但我无法从GetOrder call获得订单详细信息。我收到了成功消息,但没有收到订单。有人能帮我吗 这是我的代码: private static ApiContext getApiContext() throws IOException { String input; ApiContext apiContext = new ApiContext(); // set devId, appId, certId in Ap
private static ApiContext getApiContext() throws IOException {
String input;
ApiContext apiContext = new ApiContext();
// set devId, appId, certId in ApiAccount
ApiAccount account = new ApiAccount();
account.setDeveloper("xxxx");
account.setApplication("xxxxx");
account.setCertificate("xxxxxx");
ApiCredential cred = apiContext.getApiCredential();
cred.setApiAccount(account);
cred.seteBayToken("xxxxxxxxxxx");
apiContext.setApiServerUrl("https://api.sandbox.ebay.com/wsapi");
apiContext.setWSDLVersion("897");
return apiContext;
public static void main(String[] args) {
try {
System.out.println("===== [1] Account Information ====");
ApiContext apiContext = getApiContext();
GetOrdersCall orders = new GetOrdersCall(apiContext);
SimpleDateFormat formatter = new SimpleDateFormat("E MMM dd HH:mm:ss z yyyy");
String Startdate = "Wed Apr 20 12:53:10 IST 2015";
String Enddate = "Fri Apr 27 12:53:10 IST 2015";
Date date1 = formatter.parse(Startdate);
System.out.println(date1);
Date date2 = formatter.parse(Enddate);
System.out.println(date2);
Calendar calFrom=Calendar.getInstance();
Calendar calTo=Calendar.getInstance();
calFrom.setTime(date1);
orders.setCreateTimeFrom(calFrom);
calTo.setTime(date2);
orders.setCreateTimeTo(calTo);
orders.setWarningLevel(WarningLevelCodeType.HIGH);
orders.setOrderRole(TradingRoleCodeType.SELLER);
orders.setOrderStatus(OrderStatusCodeType.ACTIVE);
OrderType[] os = orders.getOrders();
System.out.println("Length"+os.length);
System.out.println(orders.getRequestXml()+orders.getResponseXml());
for(OrderType o:os){
System.out.println(o.getOrderID());
}
}
catch(Exception e) {
System.out.println("Fail to get order the item.");
e.printStackTrace();
}
这是请求XML:
xxxxx
897
高
2015-04-18T12:53:10+05:30
2015-04-25T12:53:10+05:30
卖方
活跃的
响应XML:
2015-04-24T07:03:42.662Z
成功
915
E915_CORE_API_17441756_R1
0
0
假的
100
1.
0
尝试将orderStatus
设置为all
。易趣api中的订单状态不太清楚
谢谢您对我的问题给予回复。我得到了答案,实际上我的代码是正确的,但错误是我购买了那些已经列出(或其他人列出)的产品,而不是我列出的(我的eaby沙盒id)