getting "The request xml was invalid."

15 views
Skip to first unread message

Michael Allman

unread,
May 6, 2010, 3:06:07 PM5/6/10
to AdWords API Forum
Hi,

I'm getting a "The request xml was invalid." message back from the
ReportService when I send a validateReportJob request. My SOAP
request looks like

<?xml version='1.0' encoding='UTF-8'?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<developerToken>XXXX</developerToken>
<useragent>Baltimore Media Group</useragent>
<password>XXXXX</password>
<email>bmg.m...@gmail.com</email>
<clientEmail>tomm...@gmail.com</clientEmail>
</env:Header>
<env:Body>
<ns1:validateReportJob xmlns:ns1="https://adwords.google.com/api/
adwords/v13">
<ns1:job ns2:type="DefinedReportJob" xmlns:ns2="http://
www.w3.org/2001/XMLSchema-instance">
<ns1:selectedReportType>Campaign</ns1:selectedReportType>
<ns1:name>Dashboard Campaign Report</ns1:name>
<ns1:aggregationTypes>Summary</ns1:aggregationTypes>
<ns1:startDay>2010-05-01</ns1:startDay>
<ns1:endDay>2010-05-31</ns1:endDay>
<ns1:campaignStatuses>Active</ns1:campaignStatuses>
<ns1:campaignStatuses>Paused</ns1:campaignStatuses>
<ns1:selectedColumns>Campaign</ns1:selectedColumns>
<ns1:selectedColumns>CampaignId</ns1:selectedColumns>
<ns1:selectedColumns>DailyBudget</ns1:selectedColumns>
<ns1:selectedColumns>Cost</ns1:selectedColumns>
<ns1:selectedColumns>Impressions</ns1:selectedColumns>
<ns1:selectedColumns>Clicks</ns1:selectedColumns>
</ns1:job>
</ns1:validateReportJob>
</env:Body>
</env:Envelope>

Funny thing is, if I change the "https://adwords.google.com/api/
adwords/v13" namespace prefix from "ns1" to "", the request works.
That is

<?xml version='1.0' encoding='UTF-8'?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<developerToken>XXXX</developerToken>
<useragent>Baltimore Media Group</useragent>
<password>XXXXX</password>
<email>bmg.m...@gmail.com</email>
<clientEmail>tomm...@gmail.com</clientEmail>
</env:Header>
<env:Body>
<validateReportJob xmlns="https://adwords.google.com/api/adwords/
v13">
<job ns2:type="DefinedReportJob" xmlns:ns2="http://www.w3.org/
2001/XMLSchema-instance">
<selectedReportType>Campaign</selectedReportType>
<name>Dashboard Campaign Report</name>
<aggregationTypes>Summary</aggregationTypes>
<startDay>2010-05-01</startDay>
<endDay>2010-05-31</endDay>
<campaignStatuses>Active</campaignStatuses>
<campaignStatuses>Paused</campaignStatuses>
<selectedColumns>Campaign</selectedColumns>
<selectedColumns>CampaignId</selectedColumns>
<selectedColumns>DailyBudget</selectedColumns>
<selectedColumns>Cost</selectedColumns>
<selectedColumns>Impressions</selectedColumns>
<selectedColumns>Clicks</selectedColumns>
</job>
</validateReportJob>
</env:Body>
</env:Envelope>

works. What am I missing?

Thanks a bunch!

Michael

--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Michael Allman

unread,
May 6, 2010, 7:07:26 PM5/6/10
to AdWords API Forum
I should clarify that this is a real road block for me. These
namespace prefixes are assigned automatically by my XML serializer. I
don't have control over their selection. Can someone please help?
This looks like a bug in the report service. How do I file?

Cheers,

Michael

On May 6, 12:06 pm, Michael Allman <javatheh...@gmail.com> wrote:
> Hi,
>
> I'm getting a "The request xml was invalid." message back from the
> ReportService when I send a validateReportJob request.  My SOAP
> request looks like
>
> <?xml version='1.0' encoding='UTF-8'?>
> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
>   <env:Header>
>     <developerToken>XXXX</developerToken>
>     <useragent>Baltimore Media Group</useragent>
>     <password>XXXXX</password>
>     <email>bmg.mcc....@gmail.com</email>
>     <clientEmail>tommy...@gmail.com</clientEmail>
>     <email>bmg.mcc....@gmail.com</email>
>     <clientEmail>tommy...@gmail.com</clientEmail>
> Also find us on our blog and discussion group:http://adwordsapi.blogspot.comhttp://groups.google.com/group/adwords-api

AdWords API Advisor

unread,
May 7, 2010, 10:08:42 AM5/7/10
to AdWords API Forum
Hi Michael,

The problem with your request is that the xsi:type of the job doesn't
have the appropriate prefix:

<ns1:job ns2:type="DefinedReportJob" xmlns:ns2="http://www.w3.org/
2001/XMLSchema-instance">

When ns1 is used for the v13 namespace you need to ensure that this
prefix is used for the xsi:type as well:

<ns1:job ns2:type="ns1:DefinedReportJob" xmlns:ns2="http://
www.w3.org/2001/XMLSchema-instance">

Best,
- Eric Koleda, AdWords API Team

Michael Allman

unread,
May 7, 2010, 2:38:52 PM5/7/10
to AdWords API Forum
Ahhhh... thank you very much, Eric. Apparently my XML parser/
serializer is not schema-aware. Damn. Well, this should be a lot
easier to fix.

Cheers,

Michael

On May 7, 7:08 am, AdWords API Advisor <adwordsapiadvi...@google.com>
wrote:
Reply all
Reply to author
Forward
0 new messages