LineItemCreativeAssociation[] licas = new LineItemCreativeAssociation[creativeIds.length];
// For each line item, associate it with the given creative.
int i = 0;
for (Long creativeId : creativeIds) {
LineItemCreativeAssociation lica = new LineItemCreativeAssociation();
lica.setCreativeId(creativeId);
lica.setLineItemId(lineItemId);
licas[i++] = lica;
}
// Create the LICAs on the server.
licas = licaService.createLineItemCreativeAssociations(licas);
if (licas != null) {
for (LineItemCreativeAssociation lica : licas) {
System.out.println("A LICA with line item ID \"" + lica.getLineItemId()
+ "\", creative ID \"" + lica.getCreativeId() + "\", and status \""
+ lica.getStatus() + "\" was created.");
}
} else {
System.out.println("No LICAs created.");
}
} catch (Exception e) {