This issue surfaced after some refactoring done in my code. Even after I reverted those changes , the problem persists. My code generates reports for Account,Keyword,Ad,Adgroup and Campaign. Even though other report download works as expected ,the Adgroup report download fails. The following is the code for the method that adds the report definition
private ReportDefinition[] addPerformanceReportdefinition(Selector selector, ReportDefinitionReportType reportType,GoogleReportDaterangeType daterangeType) throws AppException { logDebug("Adding "+reportType+"for " +selector.getPredicates()[0].getField() +":"+selector.getPredicates()[0].getValues(0)," Report date :",daterangeType); ReportDefinition reportDefinition = new ReportDefinition(); reportDefinition.setReportName(reportType+"#" + System.currentTimeMillis()); reportDefinition.setReportType(reportType); reportDefinition.setDownloadFormat(DownloadFormat.GZIPPED_XML); reportDefinition.setSelector(selector); ReportDefinitionOperation operation = new ReportDefinitionOperation(); operation.setOperand(reportDefinition); operation.setOperator(Operator.ADD); reportDefinition.setDateRangeType(getGoogleDateRangeType(daterangeType)); ReportDefinitionOperation[] operations = new ReportDefinitionOperation[] {operation}; ReportDefinition[] result=null; try{ result= service.mutate(operations); }catch(Exception e){ handleException(e); } return result; } When I try to download the AdGroup report with (writeStreamToString(new GZIPInputStream(urlConn.getInputStream()))) , I get the following exception AppException: message = GOOGLE_WS_EXCEPTION java.io.IOException: Not in GZIP format java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:143) java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:58) java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:67) Please note that this happens only for the Adgroup performance report. The very same code works perfectly fine for other reports. The debug statement in the above method prints the following **** Adding ADGROUP_PERFORMANCE_REPORTfor ExternalCustomerId:XXXX Report date :LAST_30_DAYS **** I appreciate your help in figuring out what is happening Thanks, Surya -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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