getAllAdWordsCampaigns problems after updating to V12, it throws a "There is an error in XML document" error

28 views
Skip to first unread message

ClearSense

unread,
Mar 27, 2008, 7:44:22 AM3/27/08
to AdWords API Forum
Heya,

Anyone having the same problem with the V12 CampaignService?

I had this same issue when i was upgrading to version 8, see
http://groups.google.com/group/adwords-api/browse_thread/thread/133628d6e91927e5/449178dffcbe4888?lnk=gst&q=clearsense#449178dffcbe4888

Anyway, below are the error and soap messages.

System.InvalidOperationException: There is an error in XML document
(19, 47). ---> System.FormatException: Input string was not in a
correct format.
at System.Number.StringToNumber(String str, NumberStyles options,
NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt64(String value, NumberStyles options,
NumberFormatInfo numfmt)
at System.Xml.XmlConvert.ToInt64(String s)
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaignService.Read8_ConversionOptimizerSettings(Boolean
isNullable, Boolean checkType)
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaignService.Read19_Campaign(Boolean
isNullable, Boolean checkType)
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaignService.Read45_getAllAdWordsCampaignsResponse()
at
Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer22.Deserialize(XmlSerializationReader
reader)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader, String encodingStyle, XmlDeserializationEvents events)
--- End of inner exception stack trace ---
at Bridge_it.V2.GoogleAPI.CampaignService.Invoke(String methodName,
Object[] parameters)
at
Bridge_it.V2.GoogleAPI.CampaignService.getAllAdWordsCampaigns(Int32
dummy)
at Bridge_it.V2.GoogleAPI.Connection.GetCampaigns(String myAgent,
String myUser, String myPass, String myToken, String myAppToken,
String myEmail)


-----SoapRequest at 27-3-2008 12:22:48
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/
XMLSchema"><soap:Header><applicationToken xmlns="https://
adwords.google.com/api/adwords/v12">XXXXXXXXXXXX</
applicationToken><clientEmail xmlns="https://adwords.google.com/api/
adwords/v12">XXXXXXXXXXXX</clientEmail><developerToken xmlns="https://
adwords.google.com/api/adwords/v12">XXXXXXXXXXXX</
developerToken><email xmlns="https://adwords.google.com/api/adwords/
v12">XXXXXXXXXXXX</email><password xmlns="https://adwords.google.com/
api/adwords/v12">XXXXXXXXXXXX</password><useragent xmlns="https://
adwords.google.com/api/adwords/v12">ClearSense B.V. - Bridge-It V2</
useragent></soap:Header><soap:Body><getAllAdWordsCampaigns
xmlns="https://adwords.google.com/api/adwords/v12"><dummy>0</dummy></
getAllAdWordsCampaigns></soap:Body></soap:Envelope>

-----SoapResponse at 27-3-2008 12:22:48
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<responseTime soapenv:actor="http://schemas.xmlsoap.org/soap/actor/
next" soapenv:mustUnderstand="0" xmlns="https://adwords.google.com/api/
adwords/v12">40</responseTime>
<operations soapenv:actor="http://schemas.xmlsoap.org/soap/actor/
next" soapenv:mustUnderstand="0" xmlns="https://adwords.google.com/api/
adwords/v12">2</operations>
<units soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0" xmlns="https://adwords.google.com/api/
adwords/v12">2</units>
<requestId soapenv:actor="http://schemas.xmlsoap.org/soap/actor/
next" soapenv:mustUnderstand="0" xmlns="https://adwords.google.com/api/
adwords/v12">1b31036ce249265eac71f7d1bfb6afcf</requestId>
</soapenv:Header>
<soapenv:Body>
<getAllAdWordsCampaignsResponse xmlns="https://adwords.google.com/
api/adwords/v12">
<getAllAdWordsCampaignsReturn>
<budgetAmount>30000000</budgetAmount>
<budgetOptimizerSettings>
<enabled>false</enabled>
</budgetOptimizerSettings>
<budgetPeriod>Daily</budgetPeriod>
<contentTargeting>AllPlacements</contentTargeting>
<conversionOptimizerSettings>
<enabled>false</enabled>
<maxCpaBidForAllAdGroups xsi:nil="true"/>
</conversionOptimizerSettings>
<enableSeparateContentBids>false</enableSeparateContentBids>
<endDay>2005-01-04-08:00</endDay>
<geoTargeting>
<targetAll>false</targetAll>
<countryTargets>
<countries>NL</countries>
</countryTargets>
<regionTargets xsi:nil="true"/>
<metroTargets xsi:nil="true"/>
<cityTargets xsi:nil="true"/>
<proximityTargets xsi:nil="true"/>
</geoTargeting>
<id>3118253</id>
<languageTargeting xsi:nil="true"/>
<name>XXXXXXXXXXXX</name>
<networkTargeting>
<networkTypes>SearchNetwork</networkTypes>
</networkTargeting>
<schedule>
<status>Disabled</status>
</schedule>
<startDay>2004-02-12-08:00</startDay>
<status>Paused</status>
</getAllAdWordsCampaignsReturn>
<getAllAdWordsCampaignsReturn>
<budgetAmount>220000000</budgetAmount>
<budgetOptimizerSettings>
<enabled>false</enabled>
</budgetOptimizerSettings>
<budgetPeriod>Daily</budgetPeriod>
<contentTargeting>AllPlacements</contentTargeting>
<conversionOptimizerSettings>
<enabled>false</enabled>
<maxCpaBidForAllAdGroups xsi:nil="true"/>
</conversionOptimizerSettings>
<enableSeparateContentBids>false</enableSeparateContentBids>
<endDay>2037-12-30-08:00</endDay>
<geoTargeting>
<targetAll>false</targetAll>
<countryTargets>
<countries>NL</countries>
</countryTargets>
<regionTargets xsi:nil="true"/>
<metroTargets xsi:nil="true"/>
<cityTargets xsi:nil="true"/>
<proximityTargets xsi:nil="true"/>
</geoTargeting>
<id>5464043</id>
<languageTargeting xsi:nil="true"/>
<name>XXXXXXXXXXXX</name>
<networkTargeting>
<networkTypes>SearchNetwork</networkTypes>
<networkTypes>ContentNetwork</networkTypes>
</networkTargeting>
<schedule>
<status>Disabled</status>
</schedule>
<startDay>2004-12-30-08:00</startDay>
<status>Suspended</status>
</getAllAdWordsCampaignsReturn>
</getAllAdWordsCampaignsResponse>
</soapenv:Body>
</soapenv:Envelope>


Anyone got a idea whats wrong? hope anyone can help me out.

Kind regards,

Vincent Meijer
Developer - ClearSense

turner_pg

unread,
Mar 27, 2008, 8:42:52 AM3/27/08
to AdWords API Forum
Hi,

I've come across this problem. Anyone got a fix?

Peter Turner
Webreality

On Mar 27, 11:44 am, ClearSense <v.mei...@clearsense.nl> wrote:
> Heya,
>
> Anyone having the same problem with the V12 CampaignService?
>
> I had this same issue when i was upgrading to version 8, seehttp://groups.google.com/group/adwords-api/browse_thread/thread/13362...
>
> Anyway, below are the error and soap messages.
>
> System.InvalidOperationException: There is an error in XML document
> (19, 47). ---> System.FormatException: Input string was not in a
> correct format.
>    at System.Number.StringToNumber(String str, NumberStyles options,
> NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
>    at System.Number.ParseInt64(String value, NumberStyles options,
> NumberFormatInfo numfmt)
>    at System.Xml.XmlConvert.ToInt64(String s)
>    at
> Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaig­nService.Read8_ConversionOptimizerSettings(Boolean
> isNullable, Boolean checkType)
>    at
> Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaig­nService.Read19_Campaign(Boolean
> isNullable, Boolean checkType)
>    at
> Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaig­nService.Read45_getAllAdWordsCampaignsResponse()
>    at
> Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer22.Des­erialize(XmlSerializationReader

av613

unread,
Mar 27, 2008, 11:21:49 AM3/27/08
to AdWords API Forum
I got a similar error when issuing the getCampaignList call. It works
perfectly fine with V11, but with V12 it fails with the following
error (using .NET 1.1):

Line 197: [return:
System.Xml.Serialization.XmlElementAttribute("getCampaignListReturn")]
Line 198: public Campaign[]
getCampaignList([System.Xml.Serialization.XmlElementAttribute("ids")]
int[] ids) {
Line 199: object[] results = this.Invoke("getCampaignList",
new object[] {
Line 200: ids});
Line 201: return ((Campaign[])(results[0]));

Stack Trace:


[FormatException: Input string was not in a correct format.]
System.Number.ParseInt64(String s, NumberStyles style,
NumberFormatInfo info) +0
System.Xml.XmlConvert.ToInt64(String s) +34

Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read6_ConversionOptimizerSettings(Boolean
isNullable, Boolean checkType) +427

Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read1_Campaign(Boolean
isNullable, Boolean checkType) +685

Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read46_getCampaignListResponse()
+347

[InvalidOperationException: There is an error in XML document (19,
47).]
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader) +332

System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream) +897
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) +216


Why is this happening and how to fix it???
> > Developer - ClearSense- Hide quoted text -
>
> - Show quoted text -

MorningZ

unread,
Mar 27, 2008, 2:09:07 PM3/27/08
to AdWords API Forum
I am brand new to the API and also am getting this same exact error
when trying to list the Campaigns in our account.....

AdWords API Advisor

unread,
Mar 27, 2008, 6:28:47 PM3/27/08
to AdWords API Forum
Thanks for bringing this to our attention. It would appear that
the .NET XML deserializer is getting choked up when it tries to
convert the

<maxCpaBidForAllAdGroups xsi:nil="true"/>

element into a long. I can reproduce this error as well.

I'll need some time to investigate this a bit further and escalate to
the engineering team if necessary. For what it's worth, in the v12
CampaignService WSDL, that element is defined as

<element name="maxCpaBidForAllAdGroups" minOccurs="0"
type="xsd:long"/>

and my guess is there's a conflict that comes up with the .NET SOAP
framework when you define an element with a minOccurs="0" and
returning an instance of that element set to nil--it looks like it
still tries to parse the long value out of the nil element.

Cheers,
-Jeff Posnick, AdWords API Team


On Mar 27, 7:44 am, ClearSense <v.mei...@clearsense.nl> wrote:
> Heya,
>
> Anyone having the same problem with the V12 CampaignService?
>
> I had this same issue when i was upgrading to version 8, seehttp://groups.google.com/group/adwords-api/browse_thread/thread/13362...

AV

unread,
Apr 8, 2008, 11:51:37 AM4/8/08
to AdWords API Forum
Any news on when this will be fixed?

On Mar 27, 5:28 pm, AdWords API Advisor <adwordsapiadvi...@google.com>
wrote:
> > Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaig­nService.Read8_ConversionOptimizerSettings(Boolean
> > isNullable, Boolean checkType)
> >    at
> > Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaig­nService.Read19_Campaign(Boolean
> > isNullable, Boolean checkType)
> >    at
> > Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaig­nService.Read45_getAllAdWordsCampaignsResponse()
> >    at
> > Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer22.Des­erialize(XmlSerializationReader

ovation

unread,
Apr 9, 2008, 12:09:27 PM4/9/08
to AdWords API Forum
Any word on this? This bug basically makes the Campaign useless to me.

-brian

On Mar 27, 5:28 pm, AdWords API Advisor <adwordsapiadvi...@google.com>
wrote:

AdWords API Advisor

unread,
Apr 9, 2008, 1:48:23 PM4/9/08
to AdWords API Forum
The issues around xsi:nil values and primitive .NET variable types
like longs outlined in this article

http://msdn2.microsoft.com/en-us/library/ybce7f69(VS.80).aspx

is the root cause. The engineering team will be resolving the issue by
modifying the SOAP response the server sends back. I unfortunately
can't give an exact timeline for when this will be done, but it will
obviously be sooner rather than later given that it blocks our .NET
developers from upgrading to v12.

Cheers,
-Jeff Posnick, AdWords API Team


Peer Jakobsen

unread,
Apr 9, 2008, 4:39:45 PM4/9/08
to AdWords API Forum
The problem is that in .NET V1.1 a long cannot be null. Upgrading
to .NET V2 would solve the problem.
If upgrading to V2 is not an option then a way to get around it would
be to manually modify the reference.cs converting
maxCpaBidForAllAdGroups from a long property to a string property. You
then handle the conversion from string to long at a higher level in
your code.

Cheers,
Peer Jakobsen
eSearchVision


AdWords API Advisor

unread,
Apr 10, 2008, 11:39:40 AM4/10/08
to AdWords API Forum
Hello Peer,

Upgrading to .NET 2.0 would solve the problem if the official WSDL
marked the maxCpaBidForAllAdGroups element as being nillable. However,
the WSDL doesn't list that, so even upgrading to .NET 2.0 won't
resolve the issue (unless you muck around with a local copy of the
WSDL).

The change to the SOAP server's response should resolve this issue
for users of .NET 1.x as well as .NET 2.0+. Apologies to all our .NET
developers out there in the meantime.

Cheers,
-Jeff Posnick, AdWords API Team


eint...@gmail.com

unread,
Apr 17, 2008, 3:39:04 PM4/17/08
to AdWords API Forum
This should solve the problem in .NET 2.0

In the class ConversionOptimizerSettings, change the
maxCpaBidForAllAdGroups from long to string.


On Apr 9, 1:48 pm, AdWords API Advisor <adwordsapiadvi...@google.com>
> > > > Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaig­nService.Read8_ConversionOptimizerSettings(Boolean
> > > > isNullable, Boolean checkType)
> > > >    at
> > > > Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaig­nService.Read19_Campaign(Boolean
> > > > isNullable, Boolean checkType)
> > > >    at
> > > > Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaig­nService.Read45_getAllAdWordsCampaignsResponse()
> > > >    at
> > > > Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer22.Des­erialize(XmlSerializationReader

Elocallisting

unread,
Apr 22, 2008, 7:40:41 AM4/22/08
to AdWords API Forum
Hi All...
I am also getting the same Error when using API version 12. Is
there any fix for this...


On Mar 27, 4:44 pm, ClearSense <v.mei...@clearsense.nl> wrote:
> Heya,
>
> Anyone having the same problem with the V12 CampaignService?
>
> I had this same issue when i was upgrading to version 8, seehttp://groups.google.com/group/adwords-api/browse_thread/thread/13362...
>
> Anyway, below are the error and soap messages.
>
> System.InvalidOperationException: There is an error in XML document
> (19, 47). ---> System.FormatException: Input string was not in a
> correct format.
>    at System.Number.StringToNumber(String str, NumberStyles options,
> NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
>    at System.Number.ParseInt64(String value, NumberStyles options,
> NumberFormatInfo numfmt)
>    at System.Xml.XmlConvert.ToInt64(String s)
>    at
> Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaig­nService.Read8_ConversionOptimizerSettings(Boolean
> isNullable, Boolean checkType)
>    at
> Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaig­nService.Read19_Campaign(Boolean
> isNullable, Boolean checkType)
>    at
> Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCampaig­nService.Read45_getAllAdWordsCampaignsResponse()
>    at
> Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer22.Des­erialize(XmlSerializationReader

AdWords API Advisor

unread,
Apr 29, 2008, 12:24:45 PM4/29/08
to AdWords API Forum
This issue should be resolved in the production service at this time.
The AdWords API servers will no longer send back a

<maxCpaBidForAllAdGroups xsi:nil="true"/>

in its responses, and .NET SOAP services clients should be able to
properly process the responses to CampaignService calls without
running into the above mentioned exception.

Apologies for any inconvenience this has caused .NET developers who
have been waiting to move to v12 of the AdWords API in the meantime.

Cheers,
-Jeff Posnick, AdWords API Team


On Apr 22, 4:40 am, Elocallisting <adwords.mana...@elocallisting.com>
wrote:
Reply all
Reply to author
Forward
0 new messages