Hi Jeff Posnick,

i have copy paste the code after the message  well when i placed
<criterionType>. . .. </criterionType> tag then it gives this error

Fault: 1 Code: soapenv:Server.userException String: One or more input
elements failed validation. Detail:

and i f i removed it then it gives

Fault: 1 Code: soapenv:Server.userException String:
java.lang.RuntimeException: Abstract keyValue without superclass.
Detail:

kindly guide me to resolved this problem



Best Regards
Ali


<?php
// Copyright 2008, Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * This code sample retrieves all criteria from the AdWords account
that
 * belongs to the customer issuing the request.
 */

require_once('soapclientfactory.php');


# Provide AdWords login information.
$email = 'INSERT_LOGIN_EMAIL_HERE';
$password = 'INSERT_PASSWORD_HERE';
$client_email = 'INSERT_CLIENT_LOGIN_EMAIL_HERE';
$useragent = 'INSERT_COMPANY_NAME: AdWords API PHP Sample Code';
$developer_token = 'INSERT_DEVELOPER_TOKEN_HERE';
$application_token = 'INSERT_APPLICATION_TOKEN_HERE';

# Define SOAP headers.
$headers =
  '<email>' . $email . '</email>'.
  '<password>' . $password . '</password>' .
  '<clientEmail>' . $client_email . '</clientEmail>' .
  '<useragent>' . $useragent . '</useragent>' .
  '<developerToken>' . $developer_token . '</developerToken>' .
  '<applicationToken>' . $application_token . '</applicationToken>';

# Set up service connection. To view XML request/response, change
value of
# $debug to 1. To send requests to production environment, replace
# "sandbox.google.com" with "adwords.google.com".

$namespace = 'https://adwords.google.com/api/adwords/v13';

$criterion_service =
  SoapClientFactory::GetClient($namespace . '/CriterionService?wsdl',
'wsdl');
$criterion_service->setHeaders($headers);
$debug = 0;


$id = ##########;
$adGroupId = ###########;
$paused = 'true';
$maxCpc = '200000';
$maxCpm = '100000';
$criterionType = "Keyword";
$destinationUrl = 'www.google.com';

# Get all campaigns.
$request_xml =    '<updateCriteria>' .
                                  '<criteria>'.
                                  '<id>'.$id.'</id>' .
                                  '<adGroupId>'.$adGroupId.'</adGroupId>' .     
  // '<adGroupId>'.
$adGroupId.'</adGroupId>' .
                                  '<criterionType>'.$criterionType.'</
criterionType>'.
                                  
'<destinationUrl>'.$destinationUrl.'</destinationUrl>'.
                                  '<maxCpc>'.$maxCpc.'</maxCpc>'.
                                  '<paused>'.$paused.'</paused>'.
                                  '</criteria>'.
                                  '</updateCriteria>';


    $criteria = $criterion_service->call('updateCriteria',
$request_xml);
   // $criteria = $criteria['updateCriteriaReturn'];
    if ($debug) show_xml($criterion_service);
    if ($criterion_service->fault) show_fault($criterion_service);
        exit;

function show_xml($service) {
  echo $service->request;
  echo $service->response;
  echo "\n";
}

function show_fault($service) {
  echo "\n";
  echo 'Fault: ' . $service->fault . "\n";
  echo 'Code: ' . $service->faultcode . "\n";
  echo 'String: ' . $service->faultstring . "\n";
  echo 'Detail: ' . $service->faultdetail . "\n";
  exit(0);
}
?>




On Feb 17, 9:56 pm, AdWords API Advisor <adwordsapiadvi...@google.com>
wrote:
> Hello Ali,
>
>  You're not specifying what type of criteria you're passing in. To do
> so, please include a <criterionType>Keyword</criterionType> element
> (or <criterionType>Website</criterionType>) as a child to your
> <criteria> element.
>
> Cheers,
> -Jeff Posnick, AdWords API Team
>
> On Feb 17, 2:03 am, "ali.ghaznavi.mediafl...@gmail.com"
>
> <ali.ghaznavi.mediafl...@gmail.com> wrote:
> > Dear  Jan Piotrowski (AdWords API Guru),
>
> > Thanks for your kind reply.
> > Thing is that i need to achieved this by using directly Adword Api i
> > know i am using APIlity but i need to do this directly with out using
> > it
> > that is why i have included the code that i am using it if you are a
> > real guru then fixed the bug in the code.
>
> > Regards
> > Ali
>
> > On Feb 16, 4:21 pm, "Jan Piotrowski (AdWords API Guru)"
>
> > <piotrow...@gmail.com> wrote:
> > > Try APIlity:http://google-apility.sourceforge.net/
>
> > > - Jan
>
> > > On 14 Feb., 13:10, "ali.ghaznavi.mediafl...@gmail.com"
>
> > > <ali.ghaznavi.mediafl...@gmail.com> wrote:
> > > > hello,
>
> > > > Need some help please
>
> > > > here is the code listing
>
> > > > <?php
> > > > require_once('../../_classes/google_adword_api/
> > > > soapclientfactory.php');
> > > > $email = 'INSERT_LOGIN_EMAIL_HERE';
> > > > $password = 'INSERT_PASSWORD_HERE';
> > > > $client_email = 'INSERT_CLIENT_LOGIN_EMAIL_HERE';
> > > > $useragent = 'INSERT_COMPANY_NAM';
> > > > $developer_token = 'INSERT_DEVELOPER_TOKEN_HERE';
> > > > $application_token = 'WvAJVKwu5jByZG6jVT5ZwQ';
>
> > > > # Define SOAP headers.
> > > > $headers =
> > > >   '<email>' . $email . '</email>'.
> > > >   '<password>' . $password . '</password>' .
> > > >   '<clientEmail>' . $client_email . '</clientEmail>' .
> > > >   '<useragent>' . $useragent . '</useragent>' .
> > > >   '<developerToken>' . $developer_token . '</developerToken>' .
> > > >   '<applicationToken>' . $application_token . '</applicationToken>';
>
> > > >  $namespace = 'https://adwords.google.com/api/adwords/v13';
>
> > > > $criterion_service =
> > > >   SoapClientFactory::GetClient($namespace . '/CriterionService?wsdl',
> > > > 'wsdl');
> > > > $criterion_service->setHeaders($headers);
> > > > $debug = 0;
>
> > > > $id = '0000000';
> > > > $adGroupId = '00000000';
> > > > $paused = 'true';
> > > > $maxCpc = '200000';
> > > > $maxCpm = '100000';
> > > > $criterionType = "Keyword";
> > > > $destinationUrl = 'www.google.com';
>
> > > >                 $request_xml2 =
> > > >                                   '<updateCriteria>' .
> > > >                                   '<criteria>'.
> > > >                                   
> > > > '<adGroupId>'.$adGroupId.'</adGroupId>' ..
> > > >                                   '<id>'.$id.'</id>' .
> > > >                                   
> > > > '<destinationUrl>'.$destinationUrl.'</destinationUrl>'.
> > > >                                   '<maxCpc>'.$maxCpc.'</maxCpc>'.
> > > >                                   '<maxCpm>'.$maxCpm.'</maxCpm>'.
> > > >                                   '<paused>'.$paused.'</paused>'.
> > > >                                   '</criteria>'.
> > > >                                   '</updateCriteria>';
>
> > > >                                 $criteria = 
> > > > $criterion_service->call('updateCriteria',
> > > > $request_xml2);
>
> > > >                                 if ($debug) 
> > > > show_xml($criterion_service);
> > > >                                 if ($criterion_service->fault) 
> > > > show_fault($criterion_service);
>
> > > >                                 # Convert to a list if we get back a 
> > > > single object.
> > > >                                 if (!$criteria[0]) {
> > > >                                   $criteria = array($criteria);
> > > >                                 }
>
> > > > function show_xml($service)
> > > > {
> > > >   echo $service->request;
> > > >   echo $service->response;
> > > >   echo "\n";
>
> > > > }
>
> > > > function show_fault($service) {
> > > >   echo "\n";
> > > >   echo 'Fault: ' . $service->fault . "\n";
> > > >   echo 'Code: ' . $service->faultcode . "\n";
> > > >   echo 'String: ' . $service->faultstring . "\n";
> > > >   echo 'Detail: ' . $service->faultdetail . "\n";
> > > >   exit(0);
>
> > > > }
>
> > > > ?>
>
> > > > well it gives the error and i cant under stand this please guide me
> > > > how i am going to update
>
> > > > Here is the error
>
> > > > Fault: 1 Code: soapenv:Server.userException String:
> > > > java.lang.RuntimeException:AbstractkeyValuewithoutsuperclass.
> > > > Detail:
>
> > > > Please Guide Me
>
> > > > Regards
> > > > Ali
--~--~---------~--~----~------------~-------~--~----~
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