Hello,

I am trying to create a Selector like so:
String[] adGroupIds = {"123", "234"};
SelectorBuilder builder = new SelectorBuilder();
Selector selector = builder
        .fields(AdGroupField.values())
        .in(AdGroupField.Id, adGroupIds)
        .offset(offset)
        .limit(pageSize)
        .build();

However when I pass the Selector to the AdGroupServiceInterface I get an 
INVALID_PREDICATE_VALUE and the resulting SOAP request seems to be 
malformed:
<predicates>
    <field>Id</field>
    <operator>IN</operator>
    <values>123,234</values>
</predicates>

Furthermore, if I change the .in() method to use a varargs instead 
everything works as expected:
SelectorBuilder builder = new SelectorBuilder();
Selector selector = builder
        .fields(AdGroupField.values())
        .in(AdGroupField.Id, "123", "234")
        .offset(offset)
        .limit(pageSize)
        .build();

and I get the proper SOAP request:
<predicates>
    <field>Id</field>
    <operator>IN</operator>
    <values>123</values>
    <values>234</values>
</predicates>

I was under the assumption that Java treated varargs the exact same as 
arrays but something seems to be different here.

Any help would be greatly appreciated.

Thanks!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/632e47ab-7a2d-4ce2-81af-65c98d4efc59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Issue p... Matt Jacobson
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to