Hi,

I tested your code on my end using the latest version of the Java
Client Library, and it worked without any errors.  Please post the
SOAP XML request and response from the logs so I can better
troubleshoot the issue.

Thanks,
- Eric Koleda, AdWords API Team

On Jul 28, 11:41 pm, "sree...@cybage.com" <sree...@cybage.com> wrote:
> Hi,
>
> I am new to adwords api. Please help in this.
> I am getting the below error while trying to add a campaign using Java
> api
>
> AxisFault
> faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
> faultSubcode:
> faultString: com.google.net.rpc.RpcException:
> APPLICATION_ERROR;java.lang.reflect.InvocationTargetException
>
> Here I am giving you the code :
>
> /**
> *
> */
> package googleApiPractice;
>
> /**
> * @author sreenud
> *
> */
> import com.google.api.adwords.lib.AdWordsService;
> import com.google.api.adwords.lib.AdWordsServiceLogger;
> import com.google.api.adwords.lib.AdWordsUser;
> import com.google.api.adwords.v200906.Budget;
> import com.google.api.adwords.v200906.BudgetBudgetDeliveryMethod;
> import com.google.api.adwords.v200906.BudgetBudgetPeriod;
> import com.google.api.adwords.v200906.Campaign;
> import com.google.api.adwords.v200906.CampaignOperation;
> import com.google.api.adwords.v200906.CampaignReturnValue;
> import com.google.api.adwords.v200906.CampaignServiceInterface;
> import com.google.api.adwords.v200906.CampaignStatus;
> import com.google.api.adwords.v200906.ManualCPC;
> import com.google.api.adwords.v200906.Money;
> import com.google.api.adwords.v200906.Operator;
>
> /**
> * This demo creates a new campaign.
> */
> public class AddCampaignDemo {
>   public static void main(String[] args) {
>     try {
>       // Log SOAP XML request and response.
>       AdWordsServiceLogger.log();
>
>       // Get AdWordsUser from "~/adwords.properties".
>       AdWordsUser user = new AdWordsUser("D:\\ABCWSpace\\Test\
> \adwords.properties");
>
>       // Get CampaignService.
>       CampaignServiceInterface campaignService = user.getService
> (AdWordsService.V200906.CAMPAIGN_SERVICE);
>
>       // Create new campaign structure.
>       Campaign campaign = new Campaign();
>       campaign.setName("Sample Campaign");
>       campaign.setStatus(CampaignStatus.ACTIVE);
>       campaign.setBiddingStrategy(new ManualCPC());
>
>       Budget budget = new Budget(BudgetBudgetPeriod.DAILY,
>           new Money(null, 50000000L),
>           BudgetBudgetDeliveryMethod.STANDARD);
>       campaign.setBudget(budget);
>
>       CampaignOperation operation = new CampaignOperation();
>       operation.setOperand(campaign);
>       operation.setOperator(Operator.ADD);
>
>       // Add campaign.
>       CampaignReturnValue result =
>           campaignService.mutate((new CampaignOperation[]
> {operation}));
>
>       // Display new campaigns.
>       for (Campaign campaignResult : result.getValue()) {
>         System.out.println("New campaign with name \""
>             + campaignResult.getName() + "\" and id \""
>             + campaignResult.getId() + "\" was created.");}
>
>     } catch (Exception e) {
>       e.printStackTrace();
>     }
>   }
>
> }
>
> File  D:\\ABCWSpace\\Test\\adwords.properties  has following data
>
> email=*...@***.com
> clientemail=client_1+*...@**.com
> password=****
> clientId=*****
> useragent=*****
> developertoken=*...@***.com++inr
> applicationToken=
> useSandbox=true
--~--~---------~--~----~------------~-------~--~----~
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