Backendless 4: API Services

hello , i’ve create an api serivces that takes an arraylist , useing the below code

public String sendOrders(List<Orders> orderList) {
String Clause = "";
String WhereClause = "objectId ='" + Clause + "'";
String UserId = "";
String ResturantName = "";
ArrayList<OrderDetail> orderDetails = new ArrayList<OrderDetail>();
Orders orderOnline = new Orders();
System.out.println("OrderSize " + orderList.size());
for (int i = 0; i < orderList.size(); i++) {
String restaurantId = orderList.get(i).getObjectId();
UserId = orderList.get(i).getCustomer().getObjectId();
ResturantName = orderList.get(i).getRestaurant().getName();
Orders orderNumbered = Backendless.Persistence.of(Orders.class).save(orderList.get(i));




when i try it in coderunner it works like a charm but when i deploy it to the cloud i get the following error when i call the function, am using the models downloaded with code generation ,

BackendlessFault{ code: '0', message: 'Type:"java.lang.RuntimeException", Description:"unable to adapt parameter to a method argument type. Unable to adapt array to data type: class ibrahimomer.red_dlvry.Models.MenusItems", ExceptionClass:"ServiceException"  {Msg:"none", Cause:"none"}', detail: 'Type:"java.lang.RuntimeException", Description:"unable to adapt parameter to a method argument type. Unable to adapt array to data type: class ibrahimomer.red_dlvry.Models.MenusItems"

the MenuItems class is the one downloaded from backendless and everything works fine when i try it with code runner .

Ibrahim,

What is the method signature in the service?
How do you invoke it from the client?

Regards,
Mark

this is the method ;



public void sendOrdersAsync(java.util.List&lt;Orders&gt; orderList, AsyncCallback&lt;java.lang.String&gt; callback)
{
    Object[] args = new Object[]{orderList};
    Backendless.CustomService.invoke( SERVICE_NAME, SERVICE_VERSION_NAME, "sendOrders", args, java.lang.String.class, callback);
}

and this is how i invoke it

   OrderService demo = OrderService.getInstance();
     
   demo.sendOrdersAsync(currentOfflineOrders, new AsyncCallback&lt;String&gt;() {
             @Override
             public void handleResponse(String response) {
                 Log.d("API Replay ", response);
                    }
             @Override
             public void handleFault(BackendlessFault fault) {
                 Log.d("API Replay ", fault.toString());
               
             }
         });


currentOfflineOrders is a List<Orders> , btw its the same code i use with coderunner ,with changing the version ofcourse

Thanks. What is your app id?