PlacementService.addPlacement(..) gives internal E1002- An internal error has occurred.
Hi,
We are trying to add Placement using Placement service. but PlacementService.addPlacement(Placement pc) last line in following code segment is giving internal E1002- An internal error has occurred.
We are using following code
============================
TargetingAttributeType?[] arr = aptClient.TargetingProfileService.getSupportedAdvancedTargetingAttributeTypes();
TargetingAttributeType?[] dimensionList = aptClient.TargetingDictionaryService.getSupportedTargetingAttributeTypes();
TargetingAttributeValue[] valueList = aptClient.TargetingDictionaryService.getTargetingAttributes(TargetingAttributeTy
pe.AdSize, true, 0, 344);
TargetingAttributeValue[] valueList2 = aptClient.TargetingDictionaryService.getTargetingAttributes(TargetingAttributeTy
pe.AdFormat, true, 0, 344);
Placement pc = new Placement();
pc.adAttributes = new AdAttributes();
pc.adAttributes.adSizeIDs = new long?[] { valueList[0].ID };
pc.adAttributes.adFormatID = (long)valueList2[0].ID;
pc.adAttributes.adFormatIDSpecified = true;
//pc.accountID = accountID;
pc.startDate = DateTime.Now;
pc.endDate = DateTime.Now.AddDays(30);
pc.endDateSpecified = true;
pc.originalEndDate = DateTime.Now.AddDays(70);
pc.originalEndDateSpecified = true;
pc.startDateSpecified = true;
pc.contentTargetingAttributes = new ContentTargetingAttributes();
pc.contentTargetingAttributes.placementTarget = new PlacementTarget();
pc.contentTargetingAttributes.placementTarget.ID = "28089249744"; // publisher account Id
pc.contentTargetingAttributes.placementTarget.type = PlacementTargetType.SelfManagedPublisher;
pc.contentTargetingAttributes.placementTarget.typeSpecified = true;
//Placement contains invalid price settings.
pc.guaranteedPriceSettings = new PlacementGuaranteedPriceSettings();
pc.guaranteedPriceSettings.deliveryModel = DeliveryModel.Impressions;
pc.guaranteedPriceSettings.deliveryModelSpecified = true;
//The RevenueModel must be InternalBarter for an internal order.
pc.guaranteedPriceSettings.revenueModel = RevenueModel.InternalBarter;
pc.guaranteedPriceSettings.revenueModelSpecified = true;
pc.guaranteedPriceSettings.pricingType = PricingType.CPM;
pc.guaranteedPriceSettings.pricingTypeSpecified = true;
pc.guaranteedPriceSettings.price = 100;
pc.guaranteedPriceSettings.priceSpecified = true;
pc.name = "Sm8583";
pc.adOptimization = true;
pc.adOptimizationSpecified = true;
//A required field is missing or empty: impressionGoal.
pc.guaranteedPriceSettings.impressionGoal = 100;
pc.guaranteedPriceSettings.impressionGoalSpecified = true;
pc.status = PlacementStatus.Proposal;
pc.statusSpecified = true;
Order ordr = aptClient.OrderService.getOrder(27503001);
if (ordr != null)
{
pc.orderID = ordr.ID;
pc.accountID = "0909";
pc.orderIDSpecified = true;
PlacementResponse pcRes = aptClient.PlacementService.addPlacement(pc);
}
===========================
Any suggestions.
by
1 Reply