AddOrders API - Does it set the OrderId?

Hi,

I tried to create a campaign and add an Order to it. The CampaignManagement.AddOrders() API accepts a Campaign ID and Order array. Yet post the call being made, I find that the Order[x}.OrderId field is not set by this call

I could find the OrderId from the EntityResultType which is an array of Success objects with their IDs. Is this the way the API is supposed to behave or am I missing something?

Here is my code snippet.

myOrder.OrderName ="Bollywood Order" + rndObj.Next();

myOrder.OrderStartDate =DateTime.Parse("11/15/2006");

myOrder.OrderEndDate =DateTime.Parse("12/25/2006");

myOrder.MSNDistributionSite =MSNDistributionSiteType.UnitedStates;

myOrder.KwdLanguage =LanguageType.English;

myOrder.orderTarget =null;

myOrder.CountryCode ="US";

// Add the Order to the campaign

EntityResultType result = cmObj.AddOrders(0, campaignId, orders);

myOrder.OrderId = result.SuccessRow[0].Id;

(Note the above line to set my OrderId)

[1729 byte] By [GautamBajekal] at [2008-2-15]
# 1

Yes, this is the way it works. You're passing a lot of data to adCenter and so it doesn't make sense to pass it all back to you, with the IDs set. It makes sense to only return the IDs, to save network bandwidth.

Thanks,

Shai

ShaiKariv-MSFT at 2007-9-3 > top of Msdn Tech,Windows Live Developer Forums,Microsoft adCenter: Development...

Windows Live Developer Forums

Site Classified