Closed matthewjacobson closed 5 years ago
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.
Hey, I couldn't recreate this on my installation. Are you sure that the code example above matches what's actually being sent at runtime?
I am trying to create a Selector like so:
However when I pass the Selector to the AdGroupServiceInterface I get an INVALID_PREDICATE_VALUE and the resulting SOAP request seems to be malformed:
Furthermore, if I change the .in() method to use a varargs instead everything works as expected:
and I get the proper SOAP request:
I was under the assumption that Java treated varargs the exact same as arrays but something seems to be different here.