Hi guys, im having trouble every time i i run my CustomerSync Function.
>
> i always got this error :
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: [CustomerSyncError.INVALID_CAMPAIGN_ID @ selector]
faultActor:
faultNode:
faultDetail:
{https://adwords.google.com/api/adwords/ch/v201506}ApiExceptionFault:<message>[CustomerSyncError.INVALID_CAMPAIGN_ID
> @
> selector]</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:type="ns2:CustomerSyncError"><fieldPath>selector</fieldPath><trigger/><errorString>CustomerSyncError.INVALID_CAMPAIGN_ID</errorString><ApiError.Type>CustomerSyncError</ApiError.Type><ns2:reason>INVALID_CAMPAIGN_ID</ns2:reason></errors>
> [CustomerSyncError.INVALID_CAMPAIGN_ID @ selector]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
My customer sync is in a loop for every 15 sec it will check if there is a
new campaign added.
While my system is running and then i added a new campaign it will sent me
back that error.
This is my code regarding this issue:
public static void getStatus(AdWordsServices adWordsServices,
AdWordsSession session)
throws Exception {
// Get the CampaignService.
CampaignServiceInterface campaignService =
adWordsServices.get(session, CampaignServiceInterface.class);
// Get the CustomerSyncService.
CustomerSyncServiceInterface customerSyncService =
adWordsServices.get(session, CustomerSyncServiceInterface.class);
//ResultSyncEntity parentChecker = new ResultSyncEntity();
// Get a list of all campaign IDs.
List<Long> campaignIds = new ArrayList<Long>();
Selector selector = new SelectorBuilder()
.fields(CampaignField.Id)
.build();
CampaignPage campaigns = campaignService.get(selector);
if (campaigns.getEntries() != null) {
for (Campaign campaign : campaigns.getEntries()) {
campaignIds.add(campaign.getId());
}
}
// Create date time range for the past 24 hours.
DateTimeRange dateTimeRange = new DateTimeRange();
dateTimeRange.setMin(new SimpleDateFormat("yyyyMMdd HHmmss").format(new
Date(System
.currentTimeMillis() - 1000L * 60 * 60 * 24)));
dateTimeRange.setMax(new SimpleDateFormat("yyyyMMdd HHmmss").format(new
Date()));
// Create selector.
CustomerSyncSelector customerSyncSelector = new CustomerSyncSelector();
customerSyncSelector.setDateTimeRange(dateTimeRange);
customerSyncSelector
.setCampaignIds(ArrayUtils.toPrimitive(campaignIds.toArray(new Long[] {})));
// Get all account changes for campaign.
CustomerChangeData accountChanges =
customerSyncService.get(customerSyncSelector);
// Display changes.
if (accountChanges != null && accountChanges.getChangedCampaigns() != null)
{
System.out.println("Most recent change: "
+ accountChanges.getLastChangeTimestamp() + "\n");
ResultSyncEntity.setCheckLastDateChecked(accountChanges.getLastChangeTimestamp());
for (CampaignChangeData campaignChanges :
accountChanges.getChangedCampaigns()) {
System.out.println("Campaign with id \"" + campaignChanges.getCampaignId()
+ "\" was changed: ");
System.out.println("\tCampaign changed status: "
+ campaignChanges.getCampaignChangeStatus());
StatusChecker = campaignChanges.getCampaignChangeStatus().toString();
if (StatusChecker == "NEW")
{
ChildCampaignId = campaignChanges.getCampaignId();
fetchCampaigns(adWordsServices, session);
}else
{
}
}
} else {
System.out.println("No account changes were found.");
}
}
Hope you guys can help me determine what cause and what is the fix for
this issue thanks.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/d40d767d-6a81-49f7-aca3-3f56e92cc352%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.