12 messages in com.googlegroups.adwords-apiRe: ColdFusion Adwords Implementation
FromSent OnAttachments
ecane14 Feb 2005 04:21 
Peter15 Feb 2005 03:34 
cheesenachos16 Feb 2005 09:56 
Peter21 Feb 2005 04:26 
Chris23 Feb 2005 19:31 
ecane24 Feb 2005 06:50 
ecane26 Feb 2005 08:30 
Mark27 Feb 2005 14:55 
ecane28 Feb 2005 01:52 
Chris28 Feb 2005 15:24 
Mark02 Mar 2005 08:23 
Donny24 Mar 2005 10:55 
Subject:Re: ColdFusion Adwords Implementation
From:Mark (m.@searcho2.com)
Date:02/27/2005 02:55:44 PM
List:com.googlegroups.adwords-api

Peter, this code works wonderful with CFMX 7. I was able to get your example working and created another version for getting active keywords for a particular ad group, which I'm pasting below. I took a couple tries at SETTING campaign information, but didn't have any luck. Has anyone had any luck updating any campaign settings?

<cfscript>

getGoogleWSDL = CreateObject("webservice","https://adwords.google.com/api/adwords/v2/KeywordService?wsdl");

addSOAPRequestHeader(getGoogleWSDL,"https://adwords.google.com/api/adwords/v2","email","--your email--"); addSOAPRequestHeader(getGoogleWSDL,"https://adwords.google.com/api/adwords/v2","password","--your password--"); addSOAPRequestHeader(getGoogleWSDL,"https://adwords.google.com/api/adwords/v2","token","--your token--"); addSOAPRequestHeader(getGoogleWSDL,"https://adwords.google.com/api/adwords/v2","useragent","ColdFusion AdWords");

xmloutput = getGoogleWSDL.getActiveKeywords(--your adgroupid--);

</cfscript>

<cfoutput>

<cfset #keywordCount# = #arrayLen(xmloutput)#>

<cfloop index="i" from="1" to="#keywordCount#"> <b>getLanguage:</b> #xmloutput[i].getLanguage()#<br> <b>getType:</b> #xmloutput[i].getType()#<br> <b>getId:</b> #xmloutput[i].getId()#<br> <b>getStatus:</b> #xmloutput[i].getStatus()#<br> <b>getText:</b> #xmloutput[i].getText()#<br> <b>isNegative:</b> #xmloutput[i].isNegative()#<br> <b>getAdGroupId:</b> #xmloutput[i].getAdGroupId()#<br> <b>getDestinationUrl:</b> #xmloutput[i].getDestinationUrl()#<br> <b>getMaxCpc:</b> #xmloutput[i].getMaxCpc()#<br> <hr noshade> </cfloop>

<br><br>

<!--- <cfdump var="#xmloutput#"> --->

</cfoutput>

Peter wrote:

I delegated my authentication problem to a colleague and he sorted it for me. Here is a summary of his response...

Good news and bad news. The good news is I have the API working correctly. The bad news is the feature you need- setting SOAP request headers, is not support in CFMX 6/6.1. There is a Technote about the problem, and there was a hotfix available to allow you to set SOAP request headers, but it looks like that hotfix was not included in the 6.1 Updater. I tried to get the hotfix working, but it looks like not only was the hotfix not included in the Updater, installing the hotfix on top of the Updater breaks the webservices component of CFMX. The feature is supported in CFMX 7. I would recommend upgrading rather than trying to work with the 6.1 hotfix, because the syntax has changed in 7, and because you will get a host of other new features in 7 when you upgrade. I have included your code, modified to work with the correct CFMX 7 syntax, for your reference. I tested it on my laptop running 7 Dev edition. The output from cfdump is attached as HTML:

<cfscript> CreativeServiceWSDL =

CreateObject("webservice","https://adwords.google.com/api/adwords/v2/CreativeService?WSDL");

addSOAPRequestHeader(CreativeServiceWSDL,"https://adwords.google.com/api/adwords/v2","email","x.@xx.ie");

addSOAPRequestHeader(CreativeServiceWSDL,"https://adwords.google.com/api/adwords/v2","password","xxx");

addSOAPRequestHeader(CreativeServiceWSDL,"https://adwords.google.com/api/adwords/v2","token","6123124523545435545465");

addSOAPRequestHeader(CreativeServiceWSDL,"https://adwords.google.com/api/adwords/v2","useragent","XXXX

-- Coldfusion AdWords Campaign Service Test");

creative1 = CreativeServiceWSDL.getCreative(1234,1234567890); </cfscript>

<cfoutput> #creative1.getId()#; <cfdump var="#creative1#"> </cfoutput>

cheesenachos wrote:

I haven't had any luck either. I tried with both com object and the cfcomponent tag. I don't think CF has very good support for web services (although they claim they do). CFMX 7.0 was just released so maybe this will help. I wish they had a REST implementation of the API. It would make things so much easier. - August Kleimo