I'm trying to use CheckAds but it keeps throwing the exception "There
is an error in XML document (16, 32)". The inner exception is "The
input string was not in the correct format"
I have been using the API for over a year now and have always been
able to get stuff to work. The code is
private bool CheckTextAdvert(TextAdDetail textAdDetail,
string[] languageTargets, string[] countryTargets,
AdwordsAuthenticationTicket
authenticationTicket,
ref
Webreality.GoogleAdwords.Facade.AdService.ApiError error)
{
AdService.AdService ads = new AdService.AdService();
ArrayList exceptions = new ArrayList();
bool advertIsOK = false;
ArrayList loggingInfoArray = new ArrayList();
try
{
FillAdServiceHeader(ref ads, authenticationTicket);
// Create Campaign group
TextAd ad = new TextAd();
Webreality.GoogleAdwords.Facade.AdService.ApiError[]
resultList = null;
//ad.adGroupId = textAdDetail.AdGroupID;
ad.adType = AdType.TextAd;
ad.headline = textAdDetail.Headline;
ad.description1 = textAdDetail.Description1;
ad.description2 = textAdDetail.Description2;
ad.destinationUrl = textAdDetail.DestinationUrl;
ad.displayUrl = textAdDetail.DisplayURL;
ad.exemptionRequest = null;
// Call Google API
try
{
string[] targets = new
string[countryTargets.GetLength(0)];
for (int i = 0; i < countryTargets.GetLength(0); i+
+)
{
targets[i] = countryTargets[i];
}
Webreality.GoogleAdwords.Facade.AdService.GeoTarget geoTarget = new
Webreality.GoogleAdwords.Facade.AdService.GeoTarget();
geoTarget.countryTargets = targets;
geoTarget.targetAll = false;
resultList = ads.checkAds(new Ad[] { ad },
languageTargets,
geoTarget);
CreateLoggingInfoFromObject(ref loggingInfoArray,
"checkAds", 1, true, textAdDetail);
}
catch (Exception ex)
{
CreateLoggingInfoFromObject(ref loggingInfoArray,
"checkAds", 1, false, textAdDetail);
}
etc, etc
Regards,
Peter Turner
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---