Now that I have an SOM object as a result of the soap service call:

  my $response = $soap->call($soap_action => $selector, $headers);

What is the best way to pull out the data?  Should I use $response-
>valueof(//entries) to cycle through all the entries?  We can brute
force it, using SOAP::Data and SOAP::SOM object methods.  Or, should I
be trying to bless these objects into some type of
TargetingIdeaService object that is easily traversible?

We have been unable to use the perl client libraries.  Even with the
patches, it doesn't compile for us.

Thanks in advance for any pointers you can provide.

JohnM




On Apr 5, 9:42 am, Rick <google...@ppcassurance.com> wrote:
> After a fair amount of trial and error, this works:
>
>         my $keyword = $args->{keyword};
>         my $match_type = uc($args->{match_type});
>         my $language = $args->{language} || 'en';
>         my $country = $args->{country}|| 'US';
>         my $request_type = $args->{request_type} || 'IDEAS';
>
>         my $namespace = 'https://adwords.google.com/api/adwords/o/
> v200909';
>         my $cm_namespace = 'https://adwords.google.com/api/adwords/cm/
> v200909';
>
>         my $sub_headers = SOAP::Header->value(
>                 SOAP::Header->name('authToken' =>
> google_get_token($self))->attr({'xmlns' => $cm_namespace}),
>                 SOAP::Header->name('useragent' => 'perl')->attr({'xmlns' => 
> $cm_namespace}),
>
>                 SOAP::Header->name('developerToken' => 
> $config->{'dev_token'})->attr({'xmlns' => $cm_namespace}),
>
>                 SOAP::Header->name('applicationToken' => 
> $config->{'app_token'})->attr({'xmlns' => $cm_namespace}),
>
>                 SOAP::Header->name('clientCustomerId' => 
> $config->{'clientcustomerid'})->attr({'xmlns' => $cm_namespace}));
>
>         my $headers = SOAP::Header->name('RequestHeader' => \
> $sub_headers)->attr({
>                 'xmlns' => $namespace});
>
>         my $url = $namespace . '/TargetingIdeaService';
>
>         my $soap = SOAP::Lite->service($url.'?wsdl')->autotype(0)-
>
> >proxy($url)->readable(1);
>
>         my $soap_action = SOAP::Data->name('get')->attr({'xmlns' =>
> $namespace});
>
>         my $selector = SOAP::Data->name('selector' => \SOAP::Data->value(
>
>                 SOAP::Data->name('ideaType' => 'KEYWORD'),
>                 SOAP::Data->name('requestType' =>$request_type),
>                 SOAP::Data->name('requestedAttributeTypes' =>
> 'KEYWORD'),
>                 SOAP::Data->name('requestedAttributeTypes' =>
> 'TARGETED_MONTHLY_SEARCHES'),
>                 SOAP::Data->name('requestedAttributeTypes' =>
> 'AVERAGE_TARGETED_MONTHLY_SEARCHES'),
>                 SOAP::Data->name('requestedAttributeTypes' =>
> 'COMPETITION'),
>                 SOAP::Data->name('searchParameters' => \SOAP::Data->value(
>
>                         SOAP::Data->name('keywords' => \SOAP::Data->value(
>
>                                 SOAP::Data->name('text' => $keyword)->attr({ 
> 'xmlns' => $cm_namespace }),
>
>                                 SOAP::Data->name('matchType' =>
> $match_type)->attr({ 'xmlns' => $cm_namespace }),
>                         )),
>                 ))->attr({'xsi:type' =>
> 'RelatedToKeywordSearchParameter', 'xmlns' => $namespace} ),
>                 SOAP::Data->name('searchParameters' => \SOAP::Data->value(
>
>                         SOAP::Data->name('languageTargets' =>
> \SOAP::Data->value(
>                                 SOAP::Data->name('languageCode' =>
> $language)->attr({ 'xmlns' => $cm_namespace }),
>                         )),
>                 ))->attr({'xsi:type' =>
> 'LanguageTargetSearchParameter', 'xmlns' => $namespace} ),
>                 SOAP::Data->name('searchParameters' => \SOAP::Data->value(
>
>                         SOAP::Data->name('countryTargets' =>
> \SOAP::Data->value(
>                                 SOAP::Data->name('countryCode' =>
> $country)->attr({ 'xmlns' => $cm_namespace }),
>                         )),
>                 ))->attr({'xsi:type' =>
> 'CountryTargetSearchParameter', 'xmlns' => $namespace} ),
>                 SOAP::Data->name('paging' => \SOAP::Data->value(
>                         SOAP::Data->name('startIndex' => 0)->attr({ 'xmlns' 
> => $cm_namespace }),
>
>                         SOAP::Data->name('numberResults' => 50)->attr({ 
> 'xmlns' => $cm_namespace }),
>
>                 )),
>                 SOAP::Data->name('searchParameters' => \SOAP::Data->value(
>
>                         SOAP::Data->name('keywordMatchTypes' =>
> $match_type),
>                 ))->attr({'xsi:type' =>
> 'KeywordMatchTypeSearchParameter', 'xmlns' => $namespace} ),
>
>         ));
>
>         my $response = $soap->call($soap_action => $selector,
> $headers);
>
> On Apr 2, 10:49 am, jem <surfuto...@gmail.com> wrote:
>
> > Thanks for your reply, Eric.
>
> > How do I specify the creation of the object using Soap::Data calls, or
> > something else, including the namespaces as you indicate?
>
> > My header parameter is found and accepted, and it does not look like
> > your example.  Perhaps there is some leeway into what exactly is
> > acceptable?
>
> > Also, what should the base ->get() call parameters look like?  Should
> > it be $service->get($selector,$headers);
>
> > Thanks again!
>
> > JohnM
>
> > On Apr 2, 7:22 am, AdWords API Advisor <adwordsapiadvi...@google.com>
> > wrote:

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to