Hi Eric,

Can you please tell me if V200909 targeting idea service is working for
perl  ?

I have been trying since a week, can you provide some help ?

I get an error saying
Service description '
https://adwords-sandbox.google.com/api/adwords/o/v200909?wsdl' can't be
loaded: 404 Not Found


display_stats.pl code is working fine w/o any prob but for this example I am
failed to understand whats wrong.

following is sample code I am trying to use


use strict;
    use warnings;
    use English '-no_match_vars';
    use POSIX qw();
    use SOAP::Lite;

    use Data::Dumper;

    use Google::AdWords::AuthToken ();

       my $token;
       # Provide AdWords login information.
        my $email = 'shrigondekar.a...@gmail.com';
        my $password = 'dummy';
        my $client_email =
'client_3+shrigondekar.a...@gmail.com<client_3%2bshrigondekar.a...@gmail.com>
';
        my $useragent = 'Sample';
        my $developer_token = 'shrigondekar.a...@gmail.com++usd';
        my $application_token = '';

        my $keyword = 'monkey';
        my $match_type = 'BROAD';
        my $LANGUAGE = 'en';
        my $COUNTRY = 'US';
        my $service;
        my $namespace;


       eval {
         $token = Google::AdWords::AuthToken::get_token({
           email => $email,
           password => $password,
         });
       };


    my $url = sprintf('
https://adwords-sandbox.google.com/api/adwords/o/v200909');
    my $wsdl = $url . '?wsdl';
    my $service =
SOAP::Lite->service($wsdl)->autotype(0)->readable(1)->proxy($url);


    my $msg ;
       eval {
         $service->on_fault(
           sub {
             my $response = $_[1];
             $msg = "The following SOAP fault occurred:\n" .
                    "    faultcode: " . $response->faultcode() . "\n" .
                    "    faultstring: " . $response->faultstring() ."\n";
             print $msg;
           }
         );
       };


       my $soap_header = SOAP::Header->name('RequestHeader'
=>\SOAP::Header->value(
         SOAP::Header->name('authToken'        => $token),
         SOAP::Header->name('clientEmail'      => $client_email),
         SOAP::Header->name('userAgent'        => $useragent),
         SOAP::Header->name('developerToken'   =>$developer_token),
         SOAP::Header->name('applicationToken' =>$application_token),
         SOAP::Header->name('alternateUrl'     => '
https://adwords-sandbox.google.com'),
       ));


       # my $soap_action = SOAP::Data->name('get')->attr({'xmlns'
=>$namespace});

           my $selector = SOAP::Data->name('selector' => {
             'searchParameters' => [
               {
                 'type' => 'RelatedToKeywordSearchParameter',
                 'keywords' => [
                   {
                     'text' => 'flowers',
                     'matchType' => 'BROAD',
                   },
                 ]
               },
               {
                 'type' => 'LanguageTargetSearchParameter',
                 'languageTargets' => [
                   {'languageCode' => $LANGUAGE},
                 ]
               },
               {
                 'type' => 'CountryTargetSearchParameter',
                 'countryTargets' => [
                   {'countryCode' => $COUNTRY},
                 ]
               },
             ],
             'ideaType'         => 'KEYWORD',
             'requestType'      => 'IDEAS',
             'paging'           => {
               'startIndex'     => '0',
               'numberResults'  => '10',
             }
           });

           my $som = '';
           my $som_results = '';
           eval {
             $som = $service->get('TargetingIdeaSelector'=>$selector,
 $soap_header);
             if (defined($som) && $som) {
               $som_results = $som->result();
             }
           };
           if ($@)  {
             print "Error while making SOAP request for keyword\n";
           }





-- Thanks
   Amit
  801.712.7531

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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