Hi ,
We are getting NullPointerException When trying to get CrmBasedUserList Id
in Adwords java client version v201708. This is happening once in 15
requests. This issue is happening randomly. Can you please help us getting
this issue solved.
Below is the exception stack trace.
*java.lang.NullPointerException*
at java.io.StringReader.<init>(*StringReader.java:50*)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(*SOAPPart.java:688*)
at org.apache.axis.SOAPPart.getEnvelope(*SOAPPart.java:1003*)
at org.apache.axis.Message.getSOAPHeader(*Message.java:559*)
at
com.google.api.ads.common.lib.soap.ResponseInfoXPathSet.parseMessage(
*ResponseInfoXPathSet.java:83*)
at
com.google.api.ads.common.lib.soap.axis.AxisHandler.invokeSoapCall(
*AxisHandler.java:249*)
at
com.google.api.ads.common.lib.soap.SoapServiceClient.callSoapClient(
*SoapServiceClient.java:63*)
at com.google.api.ads.common.lib.soap.SoapServiceClient.invoke(
*SoapServiceClient.java:93*)
at com.sun.proxy.$Proxy17.mutate(Unknown Source)
at
com.aaa.adwords.services.AdwordsDataServicesImpl.uploadEmailsClientId(
*AdwordsDataServicesImpl.java:116*)
at
com.aaa.adwords.services.AdwordsDataServicesImpl.uploadEmailsToGoogle(
*AdwordsDataServicesImpl.java:373*)
at com.aaa.adwords.Application.main(*Application.java:71*)
Below is the code we are using.
AdwordsUserListServiceInterface userListService =
adWordsServices.get(session, AdwordsUserListServiceInterface.*class*
);
// Create a user list.
CrmBasedUserList userList = *new* CrmBasedUserList();
userList.setName("Customer relationship management list #" + System.
*currentTimeMillis*());
userList.setDescription("A list of customers that originated from email
addresses");
// See limit here:
https://support.google.com/adwords/answer/6276125#requirements.
userList.setMembershipLifeSpan(30L);
// Create operation.
UserListOperation operation = *new* UserListOperation();
operation.setOperand(userList);
operation.setOperator(Operator.*ADD*);
// Add user list.
// Add user list.
UserListReturnValue result = *null*;
*try* {
result = userListService.mutate(*new*
UserListOperation[] { operation });
} *catch* (ApiException e) {
result = handleUserListServiceApiError(
userListService, operation, e, result);
} *catch* (Exception e) {
*LOGGER*.error("Exception in getting
userListId", e);
}
// Display user list.
UserList userListAdded = result.getValue(0);
System.*out*.printf(
"User list with name '%s' and ID %d was added.%n",
userListAdded.getName(), userListAdded.getId());
// Get user list ID.
Long userListId = userListAdded.getId();
Thanks!
Hari.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/1caa9edc-c44a-4fb5-8113-b78d324b69bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.