[Java] Spending limit of BudgetOrder is nullable?

81 views
Skip to first unread message

Brandon

unread,
Jan 25, 2015, 8:38:52 PM1/25/15
to adwor...@googlegroups.com
Hi,

I was trying to get budget information through the BudgetOrderService.

But it threw a NullPointerException when I was getting the spendingLimit, startDateTime and endDateTime from the BudgetOrder object.

I thought these aren't nullable fields.

Is there something wrong with this account, like a wrong input?

Or it's just the common case that I should deal with the null value every time?

The clientCustomerId is 5531065781.

Thanks,

Brandon

Josh Radcliff (AdWords API Team)

unread,
Jan 26, 2015, 1:06:46 PM1/26/15
to adwor...@googlegroups.com
Hi Brandon,

Did you include the field names for each of those attributes in your request's Selector, e.g., SpendingLimit, StartDateTime, EndDateTime?

Thanks,
Josh, AdWords API Team

Brandon

unread,
Jan 26, 2015, 8:09:44 PM1/26/15
to adwor...@googlegroups.com
Hi Josh,

Yes, I included all of those fields.

I got 4 BudgetOrder objects and there were only one of them had the null values.

Here's the request xml:

<?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/billing/v201409" soapenv:mustUnderstand="0">
            <ns2:clientCustomerId xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201409">5531065781</ns2:clientCustomerId>
            <ns3:developerToken xmlns:ns3="https://adwords.google.com/api/adwords/cm/v201409">DEVELOPER_TOKEN</ns3:developerToken>
            <ns4:userAgent xmlns:ns4="https://adwords.google.com/api/adwords/cm/v201409">allproducts.com:GAD:v1.1.9 (AwApi-Java, AdWords-Axis/1.36.0, Common-Java/1.36.0, Axis/1.4, Java/1.8.0_05, maven)</ns4:userAgent>
            <ns5:validateOnly xmlns:ns5="https://adwords.google.com/api/adwords/cm/v201409">false</ns5:validateOnly>
            <ns6:partialFailure xmlns:ns6="https://adwords.google.com/api/adwords/cm/v201409">false</ns6:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
            <serviceSelector>
                <ns7:fields xmlns:ns7="https://adwords.google.com/api/adwords/cm/v201409">BillingAccountId</ns7:fields>
                <ns8:fields xmlns:ns8="https://adwords.google.com/api/adwords/cm/v201409">Id</ns8:fields>
                <ns9:fields xmlns:ns9="https://adwords.google.com/api/adwords/cm/v201409">SpendingLimit</ns9:fields>
                <ns10:fields xmlns:ns10="https://adwords.google.com/api/adwords/cm/v201409">StartDateTime</ns10:fields>
                <ns11:fields xmlns:ns11="https://adwords.google.com/api/adwords/cm/v201409">EndDateTime</ns11:fields>
            </serviceSelector>
        </get>
    </soapenv:Body>
</soapenv:Envelope>

Thanks,

Brandon

Josh Radcliff (AdWords API Team)於 2015年1月27日星期二 UTC+8上午2時06分46秒寫道:

Josh Radcliff (AdWords API Team)

unread,
Jan 27, 2015, 9:31:12 AM1/27/15
to adwor...@googlegroups.com
Hi Brandon,

Thanks for confirming your selector fields. Do you still get nulls back today if you run those requests? I ask because your account was upgraded to the new billing interface on January 21st. It may be that you were requesting budget orders during that upgrade.

Thanks,
Josh, AdWords API Team

Brandon

unread,
Jan 27, 2015, 8:33:42 PM1/27/15
to adwor...@googlegroups.com
Hi Josh,

Thanks for the response.

I still got null values today.

Does it still needs a couple days to finish the upgrade?

Thanks,

Brandon

Josh Radcliff (AdWords API Team)於 2015年1月27日星期二 UTC+8下午10時31分12秒寫道:

Josh Radcliff (AdWords API Team)

unread,
Jan 28, 2015, 4:32:58 PM1/28/15
to adwor...@googlegroups.com
Hi Brandon,

This may be due to a budget order getting stuck in the pending state, possibly during the upgrade process. What's the budget order ID for the object with null values? Is it 186878453, by any chance?

Thanks,
Josh, AdWords API Team

Brandon

unread,
Jan 28, 2015, 8:02:30 PM1/28/15
to adwor...@googlegroups.com
Hi Josh,

Yes, it is 186878453.

Thanks,

Brandon

Josh Radcliff (AdWords API Team)於 2015年1月29日星期四 UTC+8上午5時32分58秒寫道:

Josh Radcliff (AdWords API Team)

unread,
Jan 29, 2015, 9:04:15 AM1/29/15
to adwor...@googlegroups.com
Hi Brandon,

Thanks for confirming. I've raised this with the budget team and will reply back once I've heard from them.

Thanks,
Josh, AdWords API Team

Josh Radcliff (AdWords API Team)

unread,
Jan 30, 2015, 3:26:12 PM1/30/15
to adwor...@googlegroups.com
Hi Brandon,

The budget team just got back to me with more details. As it turns out, budget order ID 186878453 was created via the UI and was abandoned at some point in the UI flow (e.g., the user navigated out of the budget order flow in her browser).

You could try submitting a BudgetOrderService.mutate with a REMOVE operation for that BudgetOrder if it's causing problems.

Regarding nullability, for orders created via the API, I would expect non-null values for spendingLimit, startDateTime and endDateTime. However, since a user can abandon a budget order mid-flow in the UI, it's probably best to adjust your code so it can tolerate nulls.

Thanks,
Josh, AdWords API Team

Brandon

unread,
Feb 1, 2015, 7:57:19 PM2/1/15
to adwor...@googlegroups.com
Hi Josh,

Thank you for all your assistance.

Cheers,
Brandon

Josh Radcliff (AdWords API Team)於 2015年1月31日星期六 UTC+8上午4時26分12秒寫道:
Reply all
Reply to author
Forward
0 new messages