Hi Suraj,

This is a known bug in the client library due to the (buggy) way that
soap4r handles property hashes... Check
http://code.google.com/p/google-api-adwords-ruby/issues/detail?id=19
for more information on the bug.

Essentially, what you need to do is create an object instead, and use
that. The add_ads.rb example should show you how:
http://code.google.com/p/google-api-adwords-ruby/source/browse/trunk/examples/v201003/add_ads.rb

I'm working on a completely revamped client library, where property
hashes will be the only way of specifying types, and will drop the
soap4r objects entirely.

Cheers,
Sérgio Gomes
AdWords API Team

---
On Sep 9, 12:22 am, Suraj Khakurel <sur...@adisem.com> wrote:
> Hi,
>
> Thanks for your replay,
>
> If i set exemptionRequests to nil, then it generate three nodes of 
> exemptionRequests in request xml. And if i don't set any thing then two nodes
>
>         <n2:exemptionRequests></n2:exemptionRequests>
>         <n2:exemptionRequests></n2:exemptionRequests>
>         <n2:exemptionRequests></n2:exemptionRequests
>
> Here is my code
>
> valdate_service =  adgroup_ad_check_service(client_email) // getting correct 
> adgroupadservice in validation only mode
>
>  text_ad = from_creative(creative, valdate_service) // creating TextAd Hash
>
>       text_ad_operation = {
>               :operand => {
>                       :adGroupId => xxxxx,
>                       :ad => text_ad
>               },
>               :operator => 'ADD',
>               :exemptionRequests => nil
>       }                                
>
> result =  valdate_service.mutate([text_ad_operation])
>
> it's generate  following xml.
>
>     <n2:mutate xmlns:n2="https://adwords.google.com/api/adwords/cm/v200909";>
>       <n2:operations xsi:type="n2:AdGroupAdOperation">
>         <n2:operator>ADD</n2:operator>
>         <n2:operand>
>           <n2:adGroupId>xxxxx</n2:adGroupId>
>           <n2:ad xsi:type="n2:TextAd">
>             <n2:url>http://www.mysti.com</n2:url>
>             <n2:displayUrl>www.mysti.com/Application</n2:displayUrl>
>             <n2:headline>xx Mobile App</n2:headline>
>             <n2:description1>Application, Site Web, CRM 
> Mobile</n2:description1>
>             <n2:description2>Passez au Marketing Mobile !</n2:description2>
>           </n2:ad>
>         </n2:operand>
>         <n2:exemptionRequests></n2:exemptionRequests>
>         <n2:exemptionRequests></n2:exemptionRequests>
>         <n2:exemptionRequests></n2:exemptionRequests>
>       </n2:operations>
>     </n2:mutate>
>
> I really don't  know what to do. i'm blocked here.
>
> Regards
> Suraj
> On Jul 16, 2010, at 2:41 AM, AdWords API Advisor wrote:
>
>
>
>
>
>
>
> > Hi Suraj,
>
> > These fields are part of AdGroupAdOperation class. You can set the
> > exemptionRequests field of your AdGroupAdOperation object to nil in
> > your code before making the mutate() call.
>
> > Cheers,
> > Anash P. Oommen,
> > AdWords API Advisor.
>
> > On Jul 15, 10:53 pm, Suraj Khakurel <sur...@adisem.com> wrote:
> >> Hi
>
> >> I had passed the header with parameter validateOnly is true using ruby 
> >> client library.
> >> Below is my  request xml.
> >> As you see in the xml there is two "exemptionRequests" nodes attached with 
> >> request.
> >> I think because of these two empty nodes i am getting following error:
> >> [RequiredError.REQUIRED @ operations[0].exemptionRequests[0].key, 
> >> RequiredError.REQUIRED @ operations[0].exemptionRequests[1].key]
>
> >> How can i deal with these nodes while requesting for validation ads.
>
> >> Regards
> >> Suraj
>
> >> <env:Header>
> >>   <n1:RequestHeader env:mustUnderstand="0"
> >>                     
> >> xmlns:n1="https://adwords.google.com/api/adwords/cm/v200909";>
> >>     <n1:authToken>*****</n1:authToken>
> >>     <n1:userAgent>adwords4r: Playing with the API from ruby</n1:userAgent>
> >>     <n1:developerToken>****</n1:developerToken>
> >>     <n1:clientEmail>****</n1:clientEmail>
> >>     <n1:validateOnly>true</n1:validateOnly>
> >>   </n1:RequestHeader>
> >> </env:Header>
> >> <env:Body>
> >>   <n2:mutate xmlns:n2="https://adwords.google.com/api/adwords/cm/v200909";>
> >>     <n2:operations xsi:type="n2:AdGroupAdOperation">
> >>       <n2:operator>ADD</n2:operator>
> >>       <n2:operand>
> >>         <n2:adGroupId>**341017</n2:adGroupId>
> >>         <n2:ad xsi:type="n2:TextAd">
> >>           <n2:url>http://demo.myhost.com/immobilier</n2:url>
> >>           <n2:displayUrl>demo.myhost.com</n2:displayUrl>
> >>           <n2:headline>immobilierinteractif.com</n2:headline>
> >>           <n2:description1>Choix De Biens Immobilier</n2:description1>
> >>           <n2:description2>Près de chez vous</n2:description2>
> >>         </n2:ad>
> >>       </n2:operand>
> >>       <n2:exemptionRequests></n2:exemptionRequests>
> >>       <n2:exemptionRequests></n2:exemptionRequests>
> >>     </n2:operations>
> >>   </n2:mutate>
> >> </env:Body>
> >> </env:Envelope>
>
> >> Regards
> >> Suraj
>
> > --
> > =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
> > 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 adwords-api@googlegroups.com
> > To unsubscribe from this group, send email to
> > adwords-api+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/adwords-api?hl=en

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to