try {
// Log SOAP XML request and response.
AdWordsServiceLogger.log();
// Get AdWordsUser from "~/adwords.properties".
AdWordsUser user = new AdWordsUser();
// Get the AdGroupAdService.
AdGroupAdServiceInterface adGroupAdService =
user.getService(AdWordsService.V201306.ADGROUP_AD_SERVICE);
// Get validateOnly version of the AdGroupAdService.
AdGroupAdServiceInterface adGroupAdValidationService =
user.getValidationService(AdWordsService.V201306.ADGROUP_AD_SERVICE);
long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");
// Create text ad that violates an exemptable policy. This ad will only
// trigger an error in the production environment.