Hi, First, I'm able to download the report and decompress it with GZIPPED_XML format. (not the large file) So it's not likely the server side issue. (Unless the issue happens only with a large set of results).
What error are you seeing when you decompress the donwloaded file? Also can you please check the following to narrow down the issue? - Does that happen continuously? - Does that happen with only large set of results? - GZIPPED_CSV works? - Report definition XML works instead of AWQL? Best, - Takeshi, AdWords API Team On Thursday, November 14, 2013 5:05:32 AM UTC+9, okieb...@gmail.com wrote: > > Good Afternoon Googlers, > > I am experiencing problems using GZIPPED_XML report output format. Cannot > open programmatic or with WinRAR, so worried that for very large reports I > will have to download without compression. > > SOAP Request Info: > > POST https://adwords.google.com/api/adwords/reportdownload/v201309HTTP/1.1 > User-Agent: name(gzip) > Authorization: Bearer valid token > clientCustomerId: 111222333 > developerToken: mytoken > returnMoneyInMicros: true > Content-Type: application/x-www-form-urlencoded > Accept-Encoding: gzip, deflate > Host: adwords.google.com > Content-Length: 406 > > __rdquery=SELECT Date, AdNetworkType1, CampaignId, CampaignName, > AdGroupId, AdGroupName, CityCriteriaId, MostSpecificCriteriaId, > CountryCriteriaId, LocationType, MetroCriteriaId, RegionCriteriaId, > Impressions, Clicks, Cost,AverageCpc, Ctr, Conversions, ConversionValue, > ConversionsManyPerClick, CostPerConversion FROM GEO_PERFORMANCE_REPORT > WHERE Impressions > 0 DURING 20131105,20131105&__fmt=GZIPPED_XML > > SOAP Reply Info: > > HTTP/1.1 200 OK > Content-Type: application/x-gzip; charset=UTF-8 > Content-Length: 2341277 > Content-Disposition: /tmp/reportId-null8184361572148321072.tmprpt.xml.gz > Date: Wed, 13 Nov 2013 19:30:01 GMT > Expires: Wed, 13 Nov 2013 19:30:01 GMT > Cache-Control: private, max-age=0 > X-Content-Type-Options: nosniff > X-Frame-Options: SAMEORIGIN > X-XSS-Protection: 1; mode=block > Server: GSE > > > When I use XML - everything works as designed: > > SOAP Request Info: > > POST https://adwords.google.com/api/adwords/reportdownload/v201309HTTP/1.1 > User-Agent: name > Authorization: Bearer valid token > clientCustomerId: 111222333 > developerToken: my token > returnMoneyInMicros: true > Content-Type: application/x-www-form-urlencoded > Host: adwords.google.com > Content-Length: 398 > Connection: Keep-Alive > > __rdquery=SELECT Date, AdNetworkType1, CampaignId, CampaignName, > AdGroupId, AdGroupName, CityCriteriaId, MostSpecificCriteriaId, > CountryCriteriaId, LocationType, MetroCriteriaId, RegionCriteriaId, > Impressions, Clicks, Cost,AverageCpc, Ctr, Conversions, ConversionValue, > ConversionsManyPerClick, CostPerConversion FROM GEO_PERFORMANCE_REPORT > WHERE Impressions > 0 DURING 20131111,20131111&__fmt=XML > > SOAP Reply Info: > > HTTP/1.1 200 OK > Content-Type: application/xml; charset=UTF-8 > Content-Disposition: /tmp/reportId-null2282794618592806704.tmprpt.xml > Date: Wed, 13 Nov 2013 19:50:38 GMT > Expires: Wed, 13 Nov 2013 19:50:38 GMT > Cache-Control: private, max-age=0 > X-Content-Type-Options: nosniff > X-Frame-Options: SAMEORIGIN > X-XSS-Protection: 1; mode=block > Server: GSE > Transfer-Encoding: chunked > > > Using homegrown software since 2006. Figure this is a break - since I > have same issue when running in client lib (.NET). > > My code looks like: > > 'Directory work > Dim sFileName As String > If Not Directory.Exists(SavePath) Then > Directory.CreateDirectory(SavePath) > Dim myDir As String = Me.GetMyDir(client) > > If Not Directory.Exists(myDir) Then > Directory.CreateDirectory(myDir) > > 'File naming conventions work > Dim myFile As String = "" > If client.Google.MultiDayReport Then > myFile = "GGEOM_" & Replace(client.Name, " ", "") & > client.Google.EndDate.ToString("_yyyy_MM_dd") & ".xml" > Else > myFile = "GGEOD_" & Replace(client.Name, " ", "") & > client.Google.EndDate.ToString("_yyyy_MM_dd") & ".xml" > End If > sFileName = myDir & myFile > > Dim ReportID As String = "0" > Dim myID As Integer = 0 > Dim myVID As Integer = 0 > > Dim request As HttpWebRequest = > DirectCast(WebRequest.Create(URL), HttpWebRequest) > request.UserAgent = Useragent > > 'request.UserAgent = Useragent & "(gzip)" > 'request.Headers.Add("Accept-Encoding: gzip, deflate") > > 'Dim webRequest As WebRequest = HttpWebRequest.Create(URL) > request.Headers.Add("Authorization: Bearer " + Token) > request.Headers.Add("clientCustomerId: " + > client.Google.GGLClientID) > request.Headers.Add("developerToken: " + DevToken) > request.Headers.Add("returnMoneyInMicros: true") > request.Method = "POST" > request.ContentType = "application/x-www-form-urlencoded" > > Dim postParams As String = "__rdquery=SELECT Date, > AdNetworkType1, CampaignId, CampaignName, AdGroupId, AdGroupName, > CityCriteriaId, MostSpecificCriteriaId, " & _ > "CountryCriteriaId, LocationType, MetroCriteriaId, > RegionCriteriaId, Impressions, Clicks, Cost,AverageCpc, Ctr, Conversions, > ConversionValue, " & _ > "ConversionsManyPerClick, CostPerConversion FROM > GEO_PERFORMANCE_REPORT WHERE Impressions > 0 " & _ > "DURING {0},{1}&__fmt=XML" > postParams = String.Format(postParams, > client.Google.StartDate.ToString("yyyyMMdd"), > client.Google.EndDate.ToString("yyyyMMdd")) > Dim postBytes As Byte() = Encoding.UTF8.GetBytes(postParams) > request.ContentLength = postBytes.Length > > Dim strmReq As Stream = request.GetRequestStream() > strmReq.Write(postBytes, 0, postBytes.Length) > strmReq.Close() > Dim response As WebResponse = Nothing > Try > 'Attempt to get XML Report > response = request.GetResponse() > Catch ex As Exception > 'Had problems with API - return an error indicator > Log("GOOGLE ERROR ON " & client.LogName(True) & ex.Message) > If myID = 0 And myVID = 0 Then Return "ERROR" > End Try > > > Dim responseStream As Stream = response.GetResponseStream() > Dim reader As New StreamReader(responseStream) > Dim sresponseString As String = reader.ReadToEnd() > > 'Write to file > Dim sw As StreamWriter > sw = New StreamWriter(sFileName) > sw.Write(sresponseString) > sw.Dispose() > Return "GOOD" > > 'GZIP Shit 11/12/2013 > 'Dim dir As String = Path.GetDirectoryName(sFileName) > > 'Dim decompressionFileName As String = Path.Combine(myDir, > Path.GetFileNameWithoutExtension(sFileName)) > 'Using instream As New GZipStream(File.OpenRead(sFileName), > CompressionMode.Decompress) > ' ' ArgumentException... > ' Using outputStream As New > FileStream(decompressionFileName, FileMode.Append, FileAccess.Write) > ' Dim bufferSize As Integer = 8192, bytesRead As > Integer = 0 > ' Dim buffer As Byte() = New Byte(bufferSize - 1) {} > ' While ((bytesRead = instream.Read(buffer, 0, > bufferSize)) > 0) > ' outputStream.Write(buffer, 0, bytesRead) > ' End While > ' End Using > 'End Using > > 'UnZipFile(client.Google.ReportID, myDir, myFile, True) > 'Return "GOOD" > > > All suggestions welcome and have a wonderful day. > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://googleadsdeveloper.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 --- 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 adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.