6 messages in com.googlegroups.adwords-apiRe: AdWords API Re: Apache Axis Version| From | Sent On | Attachments |
|---|---|---|
| Rajiv M | 08 Jun 2006 14:47 | |
| Daniel | 09 Jun 2006 00:04 | |
| Patrick Chanezon | 12 Jun 2006 10:17 | |
| zadda | 12 Jun 2006 15:24 | |
| Rajiv M | 13 Jun 2006 08:05 | |
| Patrick Chanezon | 13 Jun 2006 10:42 |
| Subject: | Re: AdWords API Re: Apache Axis Version![]() |
|---|---|
| From: | Patrick Chanezon (chan...@gmail.com) |
| Date: | 06/13/2006 10:42:15 AM |
| List: | com.googlegroups.adwords-api |
Zada can your turn on logging and send us the xml request and response corresponding to the failing code? Please remove your personal infor from the trace: token, emai,password.
P@
On 6/12/06, zadda <mza...@testmart.com> wrote:
Hi Rajiv,
Did you get version 1.4 to work with java axis?. We are having problems with CampaignService. It's returning "Internal error Please retry your request".
Any help is appreciated, here is the source code:
import com.google.api.adwords.lib.AdWordsService; import com.google.api.adwords.lib.AdWordsUser; import com.google.api.adwords.lib.AdWordsServiceLogger;
import com.google.api.adwords.v4.Campaign; import com.google.api.adwords.v4.CampaignService; import com.google.api.adwords.v4.AdGroupService; import com.google.api.adwords.v4.CreativeService; import com.google.api.adwords.v4.CriterionService; import com.google.api.adwords.v4.CampaignStatus; import com.google.api.adwords.v4.GeoTarget; import com.google.api.adwords.v4.AdGroup; import com.google.api.adwords.v4.Keyword; import com.google.api.adwords.v4.Criterion; import com.google.api.adwords.v4.KeywordType; import com.google.api.adwords.v4.Creative;
/** * This sample code creates a new campaign then adds an * AdGroup, Creatives and Keywords. * This example also shows how to access your clients accounts * if you are an MCC manager. */ public class CampaignServiceDemo {
static final String email = "xx....@xxx.com"; static final String password = "testing"; static final String useragent = "XXXX: Java AdWords API Demo"; static final String token = "XLKldkjfldjfljf"; // Create a new campaign with some ad groups / public static void main(String args[]) throws Exception {
// Create an AdWordsUser which we need to get to the service AdWordsUser me = new AdWordsUser(email,password,token,useragent);
// Use the AdWordsUser to get the Services CampaignService campaignService = (CampaignService)me.getService(me.CAMPAIGN_SERVICE);
// Create a new campaign with some ad groups. // First create the campaign so we can get its id. Campaign newCampaign = new Campaign(); newCampaign.setDailyBudget(new Long(1000000)); newCampaign.setName("JustTesting");
// Target the campaign at France and Spain. // Only one kind of geotargeting can be specified. GeoTarget g_target = new GeoTarget(); String[] countries = {"US"}; // g_target.setRegions(regions); g_target.setCountries(countries); newCampaign.setGeoTargeting(g_target);
String[] languages = {"en", "fr", "es"}; newCampaign.setLanguageTargeting(languages);
newCampaign.setStatus(CampaignStatus.Paused);
// Add the new campaign.
newCampaign = campaignService.addCampaign(newCampaign); int campaign_id = newCampaign.getId();
System.out.println("The campaign ID :" + campaign_id); } }
-- Patrick Chanezon, Google API Evangelist http://blog.chanezon.com/ http://www.google.com/apis/adwords/




