AdWordsUserListService ExpressionRuleUserList Rule item mismatch

40 views
Skip to first unread message

Edward Grave

unread,
Aug 21, 2017, 10:31:48 AM8/21/17
to AdWords API Forum
Hi,

I'm looking through the documentation and comparing it to the code produced by the WSDL for the AdWordsUserListService.

I've noticed a discrepancy that is causing errors in my code when calling the get function. I'm consuming the endpoint from a C# client.

From what I can tell the ExpressionRuleUserList contains a Rule object, this in turn has an array of RuleItem objects.

Currently the WSDL is creating this as a multi-dimensional array which is causing the bug:

        private RuleItem[][] groupsField;

The documentation states that the relationship of these objects is actually as follows: Rule > RuleGroups[] > Rule Items[]

However there is no RuleGroups object defined in the WSDL. Not sure if this is a bug in the Adwords API wsdl.

Has anyone else had issues with this? Is there a proper solution to this?

My workaround is to change the Reference.cs automatically produced to make the RuleItem object an array.

Cheers.

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Aug 21, 2017, 4:22:04 PM8/21/17
to AdWords API Forum
Hi 

The relationship between Rule and RuleItem is as follows : Rule -> groups(RuleItemGroup[]) -> items(RuleItem[]). In the WSDL, you should be able to find the definitions for Rule, RuleItemGroup and RuleItems as the complexType "Rule", "RuleItemGroup" and "RuleItem" respectively. I am also attaching a sample snippet from the SOAP logs which shows the relationship.  
              
                   
                      <ns2:rule>
                       
<ns2:groups>
                           
<ns2:items>
                               
<ns2:StringRuleItem>
                                   
<ns2:key>
                                       
<ns2:name>ecomm_pagetype</ns2:name>
                                   
</ns2:key>
                                   
<ns2:op>EQUALS</ns2:op>
                                   
<ns2:value>checkout</ns2:value>
                               
</ns2:StringRuleItem>
                           
</ns2:items>
                           
<ns2:items>
                               
<ns2:NumberRuleItem>
                                   
<ns2:key>
                                       
<ns2:name>cartsize</ns2:name>
                                   
</ns2:key>
                                   
<ns2:op>GREATER_THAN</ns2:op>
                                   
<ns2:value>1.0</ns2:value>
                               
</ns2:NumberRuleItem>
                           
</ns2:items>
                       
</ns2:groups>
                     
</ns2:rule>

The documentation and the WSDL seems to be consistent here. Could you please confirm what error you were getting? If you are able to share the logs it will be helpful to troubleshoot. 

Thanks,
Sreelakshmi, AdWords API Team

Edward Grave

unread,
Aug 22, 2017, 11:40:40 AM8/22/17
to AdWords API Forum
Hi Sreelakshmi,

I can confirm the WSDL matches what you state, however, when pulling this in Visual Studio as a service reference I see no mention in the Reference.cs file of an RuleItemGroup object.

public partial class Rule : object, System.ComponentModel.INotifyPropertyChanged {
        
        private RuleItem[][] groupsField;

This is a code snippet from the auto compiled Reference.cs and as you can see the groupsfield property is a multi-dimensional array of RuleItem objects. There is no mention of the RuleGroup object i would expect.

    public partial class Rule : object, System.ComponentModel.INotifyPropertyChanged {
        
        private RuleItem[] groupsField;

My work around is to remove the second set of brackets from the groupsfield. This fixes the issue with serialising the incoming response from Adwords.

The only issue with this work around is everytime I update the service reference it adds the second set of brackets into the groups field property.

Edward Grave

unread,
Aug 22, 2017, 11:53:33 AM8/22/17
to AdWords API Forum
Sorry, i didn't mean a multi-dimensional array. It's an array of arrays that the reference.cs has for the groups property.

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Aug 22, 2017, 4:20:46 PM8/22/17
to AdWords API Forum
Hi Edward, 

Since this is specific to .Net library, could you please post this on the issues tracker so that the library owner can take a look at this?

Edward Grave

unread,
Aug 23, 2017, 4:47:34 AM8/23/17
to AdWords API Forum
Ok thanks, i have done that now.
Reply all
Reply to author
Forward
0 new messages