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.