Android-从odata服务查询所有客户订单
我有WCF数据服务(来自示例MS Northwidth数据库),我的Android应用程序正在从该服务请求数据,代码为:Android-从odata服务查询所有客户订单,android,odata,Android,Odata,我有WCF数据服务(来自示例MS Northwidth数据库),我的Android应用程序正在从该服务请求数据,代码为: NorthdataService service = new NorthdataService(); Query<Customers> query = service.createCustomersQuery("/Customers"); for (Customers cust : query){ Log.d(log_tag, "Customer
NorthdataService service = new NorthdataService();
Query<Customers> query = service.createCustomersQuery("/Customers");
for (Customers cust : query){
Log.d(log_tag, "Customer Name - " + cust.getCustomerId());
}
请参阅Orders-null
此外,我知道订单上的数据是否可以获得请求:
http://Server:82/northdata.svc/Customers('ALFKI')/Orders
我尝试查询:
for (Customers cust : query){
Log.d(log_tag, "Customer Name - " + cust.getCustomerId());
String custName = "/Customers" + "('" + cust.getCustomerId() + "')" + "/Orders";
try{
Query<Customers> cquery1 = service.createCustomersQuery(custName);
for (Customers orders : cquery1){
Log.d(log_tag, "Orders2 - " + orders.toString());
}
}
catch(Exception e){}
}
如何从一个客户处获取所有OrderID?URI~/Customers('ALFKI')/$links/Products标识与Id='ALFKI'的客户相关的产品集。哦,是的!我解决了我的“问题”。。。解决方案非常简单,需要用于施工订单查询。是的,我知道如何获取ALFKI的所有订单SID?
for (Customers cust : query){
Log.d(log_tag, "Customer Name - " + cust.getCustomerId());
String custName = "/Customers" + "('" + cust.getCustomerId() + "')" + "/Orders";
try{
Query<Customers> cquery1 = service.createCustomersQuery(custName);
for (Customers orders : cquery1){
Log.d(log_tag, "Orders2 - " + orders.toString());
}
}
catch(Exception e){}
}
Orders2 - northwindmodel.Customers@40b49f68
Orders2 - northwindmodel.Customers@40c1de10
Orders2 - northwindmodel.Customers@40bdaea8
Orders2 - northwindmodel.Customers@40a6d238