Hi Senthil, I pasted this code into both the new and old java libraries for v201109 and my mutate request looks like this in both cases:
<mutate xmlns="https://adwords.google.com/api/adwords/cm/v201109"> <operations> <operator>ADD</operator> <operand> <campaignId>123</campaignId> <adExtension xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201109" xsi:type="ns2:SitelinksExtension"> <sitelinks> <displayText>Display Text</displayText> <destinationUrl>DestinationUrl</destinationUrl> </sitelinks> </adExtension> </operand> </operations> </mutate> What version of the library are you using? I tested in 8.6.0 for the old and 1.6.0 for the new. - Kevin Winter AdWords API Team On Monday, July 30, 2012 2:44:36 PM UTC-4, Senthil KS wrote: > > Anyone? > > Thanks! > > On Monday, July 30, 2012 2:11:03 AM UTC-7, Senthil KS wrote: >> >> Hi, >> >> I am not sure what I am doing wrong. I am setting the >> CampaignAdExtension.setAdExtension to SitelinksExtension. I am still not >> able to create sitelinks. When I look at the Soap request, the Operand >> contains the campaign id but empty tag for AdExtension. I am using 201109 >> version of the api. Here is my code: >> >> SitelinksExtension sitelinksExtension = new SitelinksExtension(); >> >> List<Sitelink> sitelinksList = new ArrayList<Sitelink>(); >> >> Sitelink sitelink = new Sitelink(); >> >> sitelink.setDisplayText("Display Text"); >> >> sitelink.setDestinationUrl("DestinationUrl"); >> >> sitelinksList.add(sitelink); >> >> >> >> Sitelink[] sitelinkArray = sitelinksList.toArray(new >> Sitelink[sitelinksList.size()]); >> >> sitelinksExtension.setSitelinks(sitelinkArray); >> >> >> CampaignAdExtension campaignAdExtension = new >> CampaignAdExtension(); >> >> campaignAdExtension.setCampaignId(hydraVendorCampaign.getId()); >> >> campaignAdExtension.setAdExtension(sitelinksExtension); >> >> >> //Create the operation >> >> CampaignAdExtensionOperation operation = new >> CampaignAdExtensionOperation(); >> >> operation.setOperand(campaignAdExtension); >> >> operation.setOperator(Operator.ADD); >> >> >> >> CampaignAdExtensionReturnValue retVal = >> >> campaignAdExtensionService.mutate(new >> CampaignAdExtensionOperation[] {operation}); >> >> >> if (retVal != null && retVal.getValue() != null && >> retVal.getValue().length > 0) { >> >> log.info("Created Successfully"); >> >> } else { >> >> log.error("Error creating sitelinks"); >> >> } >> >> >> Part of Request: >> >> <mutate xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns=" >> https://adwords.google.com/api/adwords/cm/v201109"><operations><operator>ADD</operator><operand><campaignId>36486119</campaignId><adExtension/></operand></operations></mutate></soapenv:Body></soapenv:Envelope >> > >> >> Part of Response: >> >> >> <serviceName>CampaignAdExtensionService</serviceName><methodName>mutate</methodName><operations>1</operations><responseTime>948</responseTime><units>1</units></ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>[CampaignAdExtensionError.MUST_USE_CONCRETE_ADEXTENSION<https://adwords.google.com/api/adwords/cm/v201109%22%3E%3CrequestId%3E0004c6081aa505180a962f1a00001d26%3C/requestId%3E%3CserviceName%3ECampaignAdExtensionService%3C/serviceName%3E%3CmethodName%3Emutate%3C/methodName%3E%3Coperations%3E1%3C/operations%3E%3CresponseTime%3E948%3C/responseTime%3E%3Cunits%3E1%3C/units%3E%3C/ResponseHeader%3E%3C/soap:Header%3E%3Csoap:Body%3E%3Csoap:Fault%3E%3Cfaultcode%3Esoap:Server%3C/faultcode%3E%3Cfaultstring%3E%5BCampaignAdExtensionError.MUST_USE_CONCRETE_ADEXTENSION>@ >> >> operations[0].operand.adExtension]</faultstring><detail><ApiExceptionFault >> xmlns=" >> https://adwords.google.com/api/adwords/cm/v201109"><message>[CampaignAdExtensionError.MUST_USE_CONCRETE_ADEXTENSION@ >> >> operations[0].operand.adExtension]</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors >> >> xsi:type="CampaignAdExtensionError" xmlns:xsi=" >> http://www.w3.org/2001/XMLSchema-instance"><fieldPath>operations[0].operand.adExtension</fieldPath><trigger/><errorString>CampaignAdExtensionError.MUST_USE_CONCRETE_ADEXTENSION</errorString><ApiError.Type>CampaignAdExtensionError</ApiError.Type><reason>MUST_USE_CONCRETE_ADEXTENSION</reason></errors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope >> > >> >> I can't figure out what's wrong. Any help would be great! >> >> >> Regards, >> >> Senthil >> >> -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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
