Reed - You are simply a life-saver. I was just heading down this path based on my own intuition that the nested struct in my CFSCRIPT approach (which works fine elsewhere) was just not going to work for addAdGroup. But I had no real idea how to build the SOAP XML body part. Your code works great and saved me probably 8 hours here. I owe you a beer dude!
Many many thanks. On Jan 7, 4:08 pm, Reed <[email protected]> wrote: > I use ColdFusion for all of our adWords API interfacing. Some of our > newer code uses the CFSCRIPT object notation, while other code > (including the > AddAdGroups calls, take the older approach of using the <CFXML> tag to > create the SOAP document, then send that document off to adWords via a > <CFHTTP> request. Below is the XML document for AddAdGroup, and it > looks just like yours, so I would second Jeff's suggestion to see what > the actual SOAP request is looking like. I hope you know how to do > that, because I never had any luck with it. It's important though, > because you're never quite sure just what Apache AXIS is doing to your > SOAP document before sending it out to adWords! I usually end up > doing a CFDUMP of the SOAP just before the CFHTTP, and crossing my > fingers that AXIS and the WSDL aren't going to stab me in the back > (more of a problem with EWS than with adWords), so if you know how to > get the SOAP tracing working on a ColdFusion server I'd be interested. > > This is what my CFXML looks like: > > <cfxml variable="variables.createAdGroup" casesensitive="true"> > <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/ > envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > <SOAP-ENV:Header> > <email>#reportinglogin#</email> > <password>#reportingpass#</password> > <useragent>xxx</useragent> > <token>#request.Token#</token> > > <developerToken>#request.DeveloperToken#</developerToken> > <applicationToken>#request.ApplicationToken# > </applicationToken> > </SOAP-ENV:Header> > <SOAP-ENV:Body> > <addAdGroup> > > <campaignID>#attributes.campaignid#</campaignID> > <newData> > <status>Enabled</status> > > <name>#attributes.adgroupname#</name> > > <keywordMaxCpc>#(attributes.maxcpc * 1000000)#</keywordMaxCpc> > </newData> > </addAdGroup> > </SOAP-ENV:Body> > </SOAP-ENV:Envelope> > </cfxml> > <cfif attributes.showDebugOutput IS "Y"> > <cfdump var="#createAdGroup#"> > </cfif> > > <cfhttp url="https://adwords.google.com/api/adwords/v12/ > AdGroupService" method="post"> > <cfhttpparam name="SOAPAction" type="header" value=""/> > <cfhttpparam type="xml" value="#ToString(variables.createAdGroup)#"/> > </cfhttp> > > On Jan 7, 3:27 pm, purdue512 <[email protected]> wrote: > > > Thanks again Jeff. > > > FYI - That resource that you've sites for CF went dead a LONG time > > ago. I posted a comment in their forum in 2007 (which had a total of 2 > > posters) and it never got any responses. I also found their code to be > > unusable and documentation poor. > > > The odd thing here is that my headers are clearly working fine as I > > have been able to build campaigns using this submission method > > (cfscript). But when I hit the more complex data structure required to > > build an AdGroup - it seems to bomb. It seems isolated to the nested > > data struct newData. Are there any examples of an addAdGroup request > > for ColdFusion around? > > > Thx --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "AdWords 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 -~----------~----~----~----~------~----~------~--~---
