ADD ExpressionRuleUserList OPERATION_NOT_SUPPORTED

260 views
Skip to first unread message

ra...@woopra.com

unread,
Dec 11, 2015, 8:57:30 AM12/11/15
to AdWords API Forum
I am trying to create a new user list along with a rule for it.  Should be pretty straight forward.  But not working.  Don't have a client library because doing this in node, (why is there no js sdk???) but my soap client works for some other requests.  I made sure I wasn't using the manager account.  Not sure what's going wrong It's probably the format of the operation because ZI get the same error if i send an empty object as the operation.  here's the request and response from my logs: (sorry about the format)

any help is appreciated. thanks

OUTGOING REQUEST:  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:tns="https://adwords.google.com/api/adwords/rm/v201509" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:cm="https://adwords.google.com/api/adwords/cm/v201509"><soap:Header><ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/rm/v201509" xmlns="https://adwords.google.com/api/adwords/rm/v201509"><ns1:userAgent>XXXXXXXXXXX</ns1:userAgent><ns1:developerToken>XXXXXXXXXXXXXXX</ns1:developerToken><ns1:clientCustomerId>XXXXXXXXX</ns1:clientCustomerId></ns1:RequestHeader></soap:Header><soap:Body><mutate xmlns="https://adwords.google.com/api/adwords/rm/v201509"><operations><operator>ADD</operator><operand><id xsi:nil="true"></id><name>Woopra Label: test-Label-Id</name><description>This User List has been created to mirror the woopra label.</description><integrationCode>test-Label-Id</integrationCode><listType>RULE_BASED</listType><rule><groups><items><key>Woopra_Label-test-Label-Id</key><op>EQUALS</op><value>true</value></items></groups></rule></operand></operations></mutate></soap:Body></soap:Envelope>


ERROR!!!! during listService.mutate():  { statusCode: 500,
  body: '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ns2:ResponseHeader xmlns:ns2="https://adwords.google.com/api/adwords/rm/v201509" xmlns="https://adwords.google.com/api/adwords/cm/v201509"><requestId>00052693bd9629000a42bf05e40XXXXX</requestId><serviceName>AdwordsUserListService</serviceName><methodName>mutate</methodName><operations>1</operations><responseTime>138</responseTime></ns2:ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>[OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0], RequiredError.REQUIRED @ operations[0].operator]</faultstring><detail><ns2:ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201509" xmlns:ns2="https://adwords.google.com/api/adwords/rm/v201509"><message>[OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0], RequiredError.REQUIRED @ operations[0].operator]</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="OperatorError"><fieldPath>operations[0]</fieldPath><trigger></trigger><errorString>OperatorError.OPERATOR_NOT_SUPPORTED</errorString><ApiError.Type>OperatorError</ApiError.Type><reason>OPERATOR_NOT_SUPPORTED</reason></errors><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequiredError"><fieldPath>operations[0].operator</fieldPath><trigger></trigger><errorString>RequiredError.REQUIRED</errorString><ApiError.Type>RequiredError</ApiError.Type><reason>REQUIRED</reason></errors></ns2:ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>',

Umesh Dengale

unread,
Dec 11, 2015, 11:06:43 AM12/11/15
to AdWords API Forum
Hello,

Thanks for providing the SOAP XML request and response logs. You are getting RequiredError.REQUIRED error as RuleItemGroup.items requires one of the RuleItem (e.g. StringRuleItemDateRuleIteNumberRuleItem etc.) Please check out the AddRuleBasedUserLists Java example code from the client library.

Thanks,
Umesh, AdWords API Team.

ra...@woopra.com

unread,
Dec 15, 2015, 3:58:03 AM12/15/15
to AdWords API Forum
Hi Umesh--

I have tried it like this too: but still get the same error: 

   
<soap:Header>
     
<ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/rm/v201509" xmlns="https://adwords.google.com/api/adwords/rm/v201509">

         
<ns1:userAgent>XX</ns1:userAgent>
         
<ns1:developerToken>XXXXX</ns1:developerToken>
         
<ns1:clientCustomerId>xxx</ns1:clientCustomerId>

     
</ns1:RequestHeader>
   
</soap:Header>
   
<soap:Body>
     
<mutate xmlns="https://adwords.google.com/api/adwords/rm/v201509">
         
<operations>
           
<operator>ADD</operator>
           
<operand>

               
<name>Woopra Label: test-label-name</name>

               
<description>This User List has been created to mirror the woopra label.</description>

               
<integrationCode>test-label-Id</integrationCode>
               
<accountUserListStatus>ACTIVE</accountUserListStatus>
               
<membershipLifeSpan>90</membershipLifeSpan>

               
<listType>RULE_BASED</listType>
               
<rule>
                 
<groups>
                     
<items>

                       
<StringRuleItem>
                           
<key>Woopra-Label: test-label-Id</key>

                           
<op>EQUALS</op>
                           
<value>true</value>

                       
</StringRuleItem>

                     
</items>
                 
</groups>
               
</rule>
           
</operand>
         
</operations>
     
</mutate>
   
</soap:Body>
</soap:Envelope>


thanks for your help!
--Ralph

ra...@woopra.com

unread,
Dec 15, 2015, 4:02:05 AM12/15/15
to AdWords API Forum
Oh btw, as I'm doing this in node, seeing this done in the java client library doesn't help much because it is so far abstracted meanwhile I am forced to build the request object manually.  Is there some reason there is no node/js client library?

--Ralph

Umesh Dengale

unread,
Dec 15, 2015, 12:33:57 PM12/15/15
to AdWords API Forum
Hi Ralph,

Thanks for providing the SOAP XML request. The RuleItem is associated with DateSpecificRuleUserList and ExpressionRuleUserList. You need to use the ExpressionRuleUserList to add the RuleItem instead of the RuleBasedUserList.
I will submit a feature request for node/js client library.

ra...@woopra.com

unread,
Dec 16, 2015, 2:28:48 AM12/16/15
to AdWords API Forum
Ok I have tried probably 30 combinations now.  I still get the same error: 

`[OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0], RequiredError.REQUIRED @ operations[0].operator]`

Unless I mess up the whole operation in which case it adds to the errors list: `RequiredError.REQUIRED @ operations[0].operand` Which happens when I try and wrap the operator/operand pair in another object like "UserListOperation"
So what this means to me is that the operand is not being read correctly.

I'm not sure exactly what you meant by "You need to use the ExpressionRuleUserList to add the RuleItem instead of the RuleBasedUserList." Perhaps you can make your suggestions directly on the xml that I send so that i can figure out how to get that output from my soap client?  But since no matter what I do to the operand the error says the same thing about the operator, I feel like there is something wrong there.  should it be literally "<ADD />" or "ADD" or what?  There isn't much room to play with the operator though...that's the flaw in my theory. :)

Here's just the body of a cleaner attempt:
 <soap:Body>
     
<mutate xmlns="https://adwords.google.com/api/adwords/rm/v201509">
         
<operations>
           
<operator>ADD</operator>
           
<operand>

               
<ExpressionRuleUserList>
                 
<id xsi:nil="true" />
                 
<name>Woopra Label: test-label-Id</name>
                 
<integrationCode>test-label-Id</integrationCode>
                 
<rule>
                     
<groups>
                       
<items>
                           
<StringRuleItem>
                             
<key>Woopra_Label-test-label-Id</key>

                             
<op>EQUALS</op>
                             
<value>true</value>
                           
</StringRuleItem>
                       
</items>
                     
</groups>
                 
</rule>

               
</ExpressionRuleUserList>

           
</operand>
         
</operations>
     
</mutate>
   
</soap:Body>


Thanks again
--Ralph

Michael Cloonan (AdWords API Team)

unread,
Dec 16, 2015, 10:01:17 AM12/16/15
to AdWords API Forum
Hello,

Rather than have a tag <ExpressionRuleUserList>, you should have <operand xsi:type="ExpressionRuleUserList">. The fields for the ExpressionRuleUserList go directly within the operand. Similarly, instead of <StringRuleItem>, you should have <items xsi:type="StringRuleItem">, and then the StringRuleItem attributes go directly within the <items> tag. Just to make it cleaner, you should also remove the <id> altogether, rather than specifying it as nil.

I am confused about why you're getting an error pointing to the operator, but hopefully cleaning up the operand to have the correct format by following the instructions above will fix it anyway.

Just to be clear, the SOAP body you posted most recently, with corrections, should look like this:

 <soap:Body>
     
<mutate xmlns="https://adwords.google.com/api/adwords/rm/v201509">
         
<operations>
           
<operator>ADD</operator>

           
<operand xsi:type="ExpressionRuleUserList">

               
<name>Woopra Label: test-label-Id</name>
               
<integrationCode>test-label-Id</integrationCode>
               
<rule>
                 
<groups>

                     
<items xsi:type="StringRuleItem">

                       
<key>Woopra_Label-test-label-Id</key>
                       
<op>EQUALS</op>
                       
<value>true</value>

                     
</items>
                 
</groups>
               
</rule>

           
</operand>
         
</operations>
     
</mutate>
   
</soap:Body>

Regards,
Mike, AdWords API Team

ra...@woopra.com

unread,
Dec 16, 2015, 4:36:32 PM12/16/15
to AdWords API Forum
Awesome!  Thanks for the in line edits!!  That really helps to clear things up for me.  I will work on this later today or tomorrow and get back to you with my success or next error message, ha ha.
--Ralph
Message has been deleted

ra...@woopra.com

unread,
Dec 17, 2015, 6:01:08 PM12/17/15
to AdWords API Forum
Hi Mike--

I got my client to build a request that looks just like yours, but now i'm getting the error about being unable to construct a ruleItem because it is abstract:

Cannot construct an instance of com.google.ads.api.services.datax.userlists.rule.RuleItem because it is abstract.  You are probably missing an @Uses annotation while invoking public abstract com.google.ads.api.services.datax.userlists.UserListReturnValue com.google.ads.api.services.datax.adwordsuserlist.AdwordsUserListService.mutate(java.util.List) throws com.google.ads.api.services.common.error.ApiException with params [[com.google.ads.api.services.datax.adwordsuserlist.v201509.jaxbgen.UserListOperation@47c87410]].

I've seen your answers to a couple other posts about similar statements, but the format of the xml requests in the answers in those threads are different enough that I can't adapt them to my own.  Here is the body of my request fixed to look like yours:


  <soap:Body>
      <mutate xmlns="https://adwords.google.com/api/adwords/rm/v201509">
         <operations>
            <operator>ADD</operator>
            <operand xsi:type="ExpressionRuleUserList">

               <name>Woopra_test_label_Id</name>
               <integrationCode>test_label_Id</integrationCode>

               <rule>
                  <groups>
                     <items xsi:type="StringRuleItem">
                        <key>

                           <name>Woopra_test_label_Id</name>

                        </key>
                        <op>EQUALS</op>
                        <value>true</value>
                     </items>
                  </groups>
               </rule>
            </operand>
         </operations>
      </mutate>
   </soap:Body>


thanks
--Ralph


On Wednesday, December 16, 2015 at 7:01:17 AM UTC-8, Michael Cloonan (AdWords API Team) wrote:

Michael Cloonan (AdWords API Team)

unread,
Dec 18, 2015, 10:01:40 AM12/18/15
to AdWords API Forum
Hello,

I apologize; I actually made a mistake. The "choice"-type elements for rule items are actually one place where you do use a tag rather than XSI type.

So, for example, the add_rule_based_remarketing_list.rb example from the Ruby client library generates a body that looks like this (significantly more complicated than what you're trying to do, but still demonstrates valid format):

   <env:Body>

     
<mutate xmlns="https://adwords.google.com/api/adwords/rm/v201509">
         
<operations>

           
<ns0:operator>ADD</ns0:operator>
           
<operand xsi:type="ExpressionRuleUserList">
               
<name>Users who checked out in November or December OR visited the checkout page with more than one item in their cart</name>
               
<description>Expression based user list</description>

               
<rule>
                 
<groups>
                     
<items>
                       
<StringRuleItem>
                           
<key>

                             
<name>ecomm_pagetype</name>
                           
</key>
                           
<op>EQUALS</op>
                           
<value>checkout</value>
                       
</StringRuleItem>
                       
<NumberRuleItem>
                           
<key>
                             
<name>cartsize</name>
                           
</key>
                           
<op>GREATER_THAN</op>
                           
<value>1.0</value>
                       
</NumberRuleItem>
                     
</items>
                 
</groups>
                 
<groups>
                     
<items>
                       
<DateRuleItem>
                           
<key>
                             
<name>checkoutdate</name>
                           
</key>
                           
<op>AFTER</op>
                           
<value>20141031</value>
                       
</DateRuleItem>
                       
<DateRuleItem>
                           
<key>
                             
<name>checkoutdate</name>
                           
</key>
                           
<op>BEFORE</op>
                           
<value>20150101</value>
                       
</DateRuleItem>

                     
</items>
                 
</groups>
               
</rule>
           
</operand>
         
</operations>

         
<operations>
           
<ns0:operator>ADD</ns0:operator>
           
<operand xsi:type="DateSpecificRuleUserList">
               
<name>Date rule user list created at 2015-12-18 09:52:45 -0500</name>
               
<description>Users who visited the site between 20141031 and 20150331 and checked out in November or December OR visited the checkout page with more than one item in their cart</description>

               
<rule>
                 
<groups>
                     
<items>
                       
<StringRuleItem>
                           
<key>

                             
<name>ecomm_pagetype</name>
                           
</key>
                           
<op>EQUALS</op>
                           
<value>checkout</value>
                       
</StringRuleItem>
                       
<NumberRuleItem>
                           
<key>
                             
<name>cartsize</name>
                           
</key>
                           
<op>GREATER_THAN</op>
                           
<value>1.0</value>
                       
</NumberRuleItem>
                     
</items>
                 
</groups>
                 
<groups>
                     
<items>
                       
<DateRuleItem>
                           
<key>
                             
<name>checkoutdate</name>
                           
</key>
                           
<op>AFTER</op>
                           
<value>20141031</value>
                       
</DateRuleItem>
                       
<DateRuleItem>
                           
<key>
                             
<name>checkoutdate</name>
                           
</key>
                           
<op>BEFORE</op>
                           
<value>20150101</value>
                       
</DateRuleItem>
                     
</items>
                 
</groups>
               
</rule>
               
<startDate>20141031</startDate>
               
<endDate>20150331</endDate>
           
</operand>
         
</operations>
     
</mutate>
   
</env:Body>

One notable difference is that the operator element has a namespace defined. ns0 in this example request is defined on the Envelope as xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201509".

Try specifying the correct namespace on your operator to see if that resolves the problem.

Again, I apologize for getting it wrong at first; this is actually one of the only places in the API where xsi:type isn't used to differentiate.

Regards,
Mike, AdWords API Team

ra...@woopra.com

unread,
Dec 18, 2015, 7:38:24 PM12/18/15
to AdWords API Forum
Giving this a try.  Still working on it but the first attempts have given me Unmarshalling errors i think due to "prefix unbound" right at the end of <ns0:operator>:
 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Unmarshalling Error: ParseError at [row,col]:[1,761]\nMessage: http://www.w3.org/TR/1999/REC-xml-names-19990114#ElementPrefixUnbound?ns0&amp;ns0:operator </faultstring></soap:Fault></soap:Body></soap:Envelope>

This is my first time interacting with soap api so Im not sure if this could be related to my envelope being off or what.  Trying more things now.  

Oh here's the whole request btw in case you can spot something faster: 

Ok something is wrong because my xml formatter throws the same error so here it is raw:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:tns="https://adwords.google.com/api/adwords/rm/v201509" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:cm="https://adwords.google.com/api/adwords/cm/v201509"><soap:Header><ns0:RequestHeader xmlns:ns0="https://adwords.google.com/api/adwords/rm/v201509" xmlns="https://adwords.google.com/api/adwords/rm/v201509"><ns0:userAgent>Woopra:AppConnect:getTrackers</ns0:userAgent><ns0:developerToken>XXXXX</ns0:developerToken><ns0:clientCustomerId>4579826953</ns0:clientCustomerId></ns0:RequestHeader></soap:Header><soap:Body><mutate xmlns="https://adwords.google.com/api/adwords/rm/v201509"><operations><ns0:operator>ADD</ns0:operator><operand xsi:type="ExpressionRuleUserList"><name>Woopra_test_label_Id</name><description>This User List has been created to mirror the woopra label.</description><integrationCode>test_label_Id</integrationCode><rule><groups><items><StringRuleItem><key><name>Woopra_test_label_Id</name></key><op>EQUALS</op><value>true</value></StringRuleItem></items></groups></rule></operand></operations></mutate></soap:Body></soap:Envelope>


Michael Cloonan (AdWords API Team)

unread,
Jan 4, 2016, 9:52:39 AM1/4/16
to AdWords API Forum
Hello,

I apologize for the long delay in response. You should define your xmlns:ns0 on the soap:Envelope element, not on the RequestHeader. Note that the ns0:operator isn't within the RequestHeader, so that definition would be lost by the time you get to that part of the XML. Moving it up a level will ensure the definition is still found.

Regards,
Mike, AdWords API Team

ra...@woopra.com

unread,
Jan 5, 2016, 6:41:14 PM1/5/16
to AdWords API Forum
HI Michael--
No problem! I was out of town too.  Happy New Year!

I fixed the unmarshalling issue, and on my test account, I finally got the error I was expecting: "AuthorizationError.USER_PERMISSION_DENIED"

However when i switched over to make the call on our production account, It went back to the same error: "[OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0], RequiredError.REQUIRED @ operations[0].operator]"


My soap client does not seem to allow me to add custom attributes to the envelope but I added the ns0 on the operations tag.  (Also adding validateOnly as testing on production account now.
Here was my request:

      <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/rm/v201509" xmlns="https://adwords.google.com/api/adwords/rm/v201509">
         <ns1:userAgent>Woopra:AppConnect:getTrackers</ns1:userAgent>
         <ns1:developerToken>XXX</ns1:developerToken>
         <ns1:clientCustomerId>XXX</ns1:clientCustomerId>
         <ns1:validateOnly>true</ns1:validateOnly>
      </ns1:RequestHeader>

   </soap:Header>
   <soap:Body>
      <mutate xmlns="https://adwords.google.com/api/adwords/rm/v201509">

            <ns0:operator>ADD</ns0:operator>
            <operand xsi:type="ExpressionRuleUserList">
               <name>Woopra_test_label_Id</name>
               <description>This User List has been created to mirror the woopra label.</description>
               <integrationCode>test_label_Id</integrationCode>
               <rule>
                  <groups>
                     <items>
                        <StringRuleItem>
                           <key>
                              <name>Woopra_test_label_Id</name>
                           </key>
                           <op>EQUALS</op>
                           <value>true</value>
                        </StringRuleItem>
                     </items>
                  </groups>
               </rule>
            </operand>
         </operations>
      </mutate>
   </soap:Body>
</soap:Envelope>


Sorry for all this.  I really do wish there was a node library...
--Ralph

Michael Cloonan (AdWords API Team)

unread,
Jan 6, 2016, 9:21:30 AM1/6/16
to AdWords API Forum
Hello,

The only thing I can think of if the request works on a test account but not on your production account is that possibly you actually don't have write permissions on your production account. Are you able to make mutate calls on any other services, or do you get this error on every mutate call for this account? You may have to regenerate your refresh token from an account that has full admin permissions.

Regards,
Mike, AdWords API Team
...

Ralph Samuel

unread,
Jan 6, 2016, 3:53:31 PM1/6/16
to adwordsapiad...@google.com, AdWords API Forum
That's sort of what I was thinking and that's why I used this other account.  The accounts and permissions and stuff are pretty complex so i will go through again and make sure everything is in order there and report back.

Thanks
--Ralph

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/osBZcV05iqo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
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/a29ca92f-5650-48c1-8d65-63d7bedbc5ec%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

ra...@woopra.com

unread,
Jan 7, 2016, 4:28:39 PM1/7/16
to AdWords API Forum
Hi Michael--

So I have continued to try this with the admin account on our production adwords account, and I'm always getting these same two errors: [OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0], RequiredError.REQUIRED @ operations[0].operator].  To clarify, I did not get it to work on the test account, I mis-spoke when I said it worked there.  I get these errors when using a test manager account, a production manager account, and a production client account.  I get the user permission denied on a different unused production client account for some reason (possibly because there is no credit card on file for it yet?)  I do not actually have a test client account under my test manager account.  

I think all this about my accounts is accurate, but all the different kinds of accounts and their functionality is pretty complex so I can't be sure ha ha.

I don't think it is a permissions issue as I only have admins on the accounts, and my xml requests look almost exactly like the examples I've found in the docs and from you in this thread.  I am sort of at a loss as to what is going on.  I am considering using one of your client libraries to manually make the call and compare the raw xml to mine as a next step.

If you have any other ideas for what I could try, I'm open to suggestions.

--Ralph

Nadine Sundquist (AdWords API Team)

unread,
Jan 8, 2016, 10:50:55 AM1/8/16
to AdWords API Forum
Hi Ralph,

Mike asked me to take a look at this as well to see if I saw anything. I noticed something that may be causing the issue. I believe that you want to change:
to


I'm hoping it's as simple as changing one character.

You mentioned wanting to see what one of the client libraries will output. Here's what Perl outputs; this is only the first part because it's a bit wordy. You can see why I'm thinking a one letter change may make a difference.

 <mutate xmlns="https://adwords.google.com/api/adwords/rm/v201509"> <operations> <operator xmlns="https://adwords.google.com/api/adwords/cm/v201509">ADD</operator> <operand xsi:type="ExpressionRuleUserList"> <name>Expression based user list created at 20160108_103956</name> <description>Users who checked out in six month window OR visited the checkout page with more than one item in their cart</description> <rule> <groups> <items> <StringRuleItem> <key>

Cheers,
Nadine, AdWords API Team

Ralph Samuel

unread,
Jan 8, 2016, 5:49:00 PM1/8/16
to adwordsapiad...@google.com, AdWords API Forum
Oh Cool!  I noticed the cm/rm dichotomy before but didn't remember to think about it for this problem.  Thanks! I'll give that a try

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/osBZcV05iqo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.

ra...@woopra.com

unread,
Jan 8, 2016, 6:50:47 PM1/8/16
to AdWords API Forum
Holly Shit it worked!  Thank you! Good catch by the way.  How did you find that and how do i avoid this sort of thing in the future?  

What exactly are these namespaces and what's the cm/rm difference?  Are these namespaces built in to soap protocol as just strings to separate services that go over the same http interface? (the url doesn't seem to lead anywhere) Or are the urls actually providing some resource to the soap server to configure it for the request?

I am very new to soap.

Thanks for all the help guys!
--Ralph

Nadine Sundquist (AdWords API Team)

unread,
Jan 11, 2016, 4:12:55 PM1/11/16
to AdWords API Forum
Hi Ralph,

Woohoo!!! I was holding my breath for a possible problem behind that one. I've probably spent a few too many cycles of my life staring at XML, and I've built SOAP XML from scratch before. I've had the same kind of gotcha moment.

What are namespaces?
Namespaces are created in XML to avoid naming conflicts. The closest concept I can reference is a Java package. You can have two classes with the same name in two different Java packages. The way it relates to the AdWords API is that some of our services live in separate namespaces. Sometimes, one service may reference components that come from another namespace. That's what happened to you here.

How do I avoid this in the future?

Option 1
The way we avoid this in the client libraries is that we use tools (such as Apache Axis or Apache CXF for Java) to generate code from the existing WSDLs (definitions of each AdWords API service). I haven't given it a try myself, but there's probably something for js as well.

Option 2
* Short Explanation
If you're checking this manually, you can use a tool to check your XML against the WSDL that we provide. Just Google validate XML against WSDL. There are a couple of options that will come up for free tools. If you're thinking, "What's a WSDL, and where do I find it for the AdWords API?", read on.
* Long Explanation
If you're not using that many services, then you may not want to go through the effort of doing this. However, you want to double-check that you have the right namespaces by manually checking. WSDLs to the rescue! So, let's say you want to check out the AdWordsUserListService. You would go to that page in the documentation for that service, and you would click on the link under Production WSDL. Every service has one of these. You'll notice in the URL, that you'll see the namespace for that service e.g. https://adwords.google.com/api/adwords/rm/v201509/AdwordsUserListService?wsdl has the rm. The targetNamespace is also defined the same way. For your OPERATOR example, Look for OPERATOR in the file. Then work your way up the XML structure until you find a namespace. You'll then bump into the namespace with the cm in it. Rather than eyeballing it, it's nice to have a tool double-check your XML for you.

Happy coding,
Nadine, AdWords API Team

ra...@woopra.com

unread,
Jan 22, 2016, 7:29:00 PM1/22/16
to AdWords API Forum
Nadine--

Sorry for the delayed response--once this problem was solved i hit the ground running on my AdWords integration.  Everything is working beautifully now, and I was far better able to debug other similar problems I ran into now that I have a better understanding of soap and the xml behind it.

Thank you so much for your detailed explanation!  This soap stuff makes much better sense now! ha ha.  As does the wsdl.  I was using a soap client to compile the xml...not sure why it missed these lines: 

<extension base="cm:Operation">

But now i can check!

I really appreciate you taking the time to teach me this.  Above and beyond...

Thanks again,
--Ralph

Nadine Sundquist (AdWords API Team)

unread,
Jan 25, 2016, 9:29:34 AM1/25/16
to AdWords API Forum
Hi Ralph,

No worries on the delayed response; I know what it's like to get caught up in code when you've made a breakthrough. It sounds like you'll be an expert on SOAP in no time. If you need any further help, you know where to find us!

Have a wonderful day!
Nadine, AdWords API Team
Reply all
Reply to author
Forward
0 new messages