Hello Peter,

 That exception text is coming from the .NET runtime, not from a SOAP
fault generated on the server. It's not clear from what you posted
whether the exception is triggered before your request is sent or
after the response is received. I'd think it's more likely that your
code is generating a request with invalid XML rather than the response
the SOAP server is sending containing invalid XML.

 So, the question is, what exactly is being serialized into your XML
request that might be generating the error? Can you check your
parameters to see if there is anything that looks dodgy--maybe
something that isn't valid UTF-8 data? And if you enable full SOAP
request/response logging, do you get to the point where you can see
some of the serialized XML in your SOAP request before the exception
is thrown?

Cheers,
-Jeff Posnick, AdWords API Team


On Oct 16, 10:48 am, peterwebreality <[EMAIL PROTECTED]> wrote:
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to