Inconsistent DateRange SOAP structure

48 views
Skip to first unread message

Siu Pang Tommy Choi

unread,
Jan 20, 2017, 9:11:17 AM1/20/17
to AdWords API Forum
Hi everyone,

I am studying the underlying SOAP request and response of AdWords API.
In AccountLabelService.wsdl, complex type DateRange has properties min and max which are of the type tns:Date
But in CampaignService.wsdl, min and max of DateRange are of the type xsd:string
They are all under same target namespace https://adwords.google.com/api/adwords/cm/v201609

By posting this hand crafting SOAP request (I omitted soap header part) to https://adwords.google.com/api/adwords/mcm/v201609/AccountLabelService

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<soap:Body>
<selector>
<min><year>2016</year><month>1</month><day>1</day></min>
<max><year>2017</year><month>1</month><day>1</day></max>
</dateRange>
</selector>
</get>
</soap:Body>
</soap:Envelope>

I can get status 200.



But if I picked another structure and posted it again to https://adwords.google.com/api/adwords/mcm/v201609/AccountLabelService

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<soap:Body>
<selector>
<min>20160101</min>
<max>20170101</max>
</dateRange>
</selector>
</get>
</soap:Body>
</soap:Envelope>

I got an error status 500 and the reason was EARLIER_THAN_MINIMUM_DATE

Since in the C# client library the DateRange follows the SOAP structure as defined in CampaignService.wsdl
When I tried to run the above request via C# client library, I got the same 500 error and the same reason.

Is it a bug?

Josh Radcliff (AdWords API Team)

unread,
Jan 20, 2017, 4:05:24 PM1/20/17
to AdWords API Forum
Hi,

First of all, kudos to you for looking through the services so carefully! :)

You're absolutely correct that there's an inconsistency here -- I'll follow up to see if we can fix this, although for compatibility reasons, any fix will be in a future version of the API. We avoid changing WSDLs for existing versions, since that can cause issues for users of the AdWords API.

The good news is that the DateRange elements on Selectors are left over from the days long long ago where AdWords API services returned reporting stats. Now that reporting stats are retrieved via reports instead, the DateRange element is ignored by all services except reporting (see the Note: on Selector.dateRange), so you should not set that attribute of your Selector when making non-reporting calls.

Thanks,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages