OrderType newOrder = new OrderType();
ShippingDetailsType shippingDetail = (ShippingDetailsType) order.getShippingDetails();
if (trackingOrders.size() > 0) {
ShipmentTrackingDetailsType[] trackDetails = new ShipmentTrackingDetailsType[trackingOrders.size()];
for (int i = 0; i < trackDetails.length; i++) {
ShipmentTrackingDetailsType track = new ShipmentTrackingDetailsType();
track.setShipmentTrackingNumber(trackingOrders.get(i).get("trackingCodeId").toString());
trackDetails[i] = track;
}
shippingDetail.setShipmentTrackingDetails(trackDetails);
newOrder.setShippingDetails(shippingDetail);
}