// Create an array to store local order objects.
Order[] orders = new Order[5];
for (int i = 0; i < 5; i++) {
Order order = new Order();
order.setName("Order #" + i);
order.setAdvertiserId(advertiserId);
order.setSalespersonId(salespersonId);
order.setTraffickerId(traffickerId);
orders[i] = order;
}
// Create the orders on the server.
orders = orderService.createOrders(orders);
if (orders != null) {
for (Order order : orders) {
System.out.println("An order with ID \""
+ order.getId() + "\" and named \"" + order.getName() + "\" was created.");
}
} else {
System.out.println("No orders created.");
}
} catch (Exception e) {