Avatar of Dustin Stanley
Dustin Stanley

asked on 

MS Access VBA How To Decompress a Gzip Response From a HTTP Request

I have finally been able to get a response from a API call and it now sends me back a response which has a Gzip file in it. How can I automate this in VBA to:
1. Decompress this response.
2. Decode it
3. Save it as a file for me to view.

Thanks.

Fiddler Response Raw view looks like this:
Header:
POST https://storage.sandbox.ebay.com/FileTransferService HTTP/1.1
X-EBAY-SOA-SERVICE-NAME: FileTransferService
X-EBAY-SOA-OPERATION-NAME: downloadFile
X-EBAY-SOA-SECURITY-TOKEN: TOKEN CODE HERE
User-Agent: Fiddler
Host: storage.sandbox.ebay.com
Content-Length: 230

<?xml version="1.0" encoding="UTF-8"?>
<downloadFileRequest xmlns="http://www.ebay.com/marketplace/services">
<taskReferenceId>500165386</taskReferenceId>
<fileReferenceId>500147856</fileReferenceId>
</downloadFileRequest>

Open in new window


Response Body:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-EBAY-SOA-SERVICE-METRICS: 86007804
X-EBAY-SOA-REQUEST-ID: 15b5d9c9-8e30-a471-d2e2-61b2fffb98c2!FileTransferService!10.71.29.46!v3apibulksandboxcore[]
X-EBAY-SOA-SERVICE-VERSION: 1.1.0
X-EBAY-SOA-MESSAGE-PROTOCOL: NONE
X-EBAY-SOA-RESPONSE-DATA-FORMAT: XML
X-EBAY-SOA-OPERATION-NAME: downloadFile
X-EBAY-SOA-SERVICE-NAME: {http://www.ebay.com/marketplace/services}FileTransferService
Content-Type: multipart/related;boundary=MIMEBoundaryurn_uuid_C91296EA5FF69EE9571491924195649953194;type="application/xop+xml";start="<0.urn:uuid:C91296EA5FF69EE9571491924195649953195>";start-info="text/xml"
Date: Tue, 11 Apr 2017 15:23:15 GMT
Content-Length: 11125

--MIMEBoundaryurn_uuid_C91296EA5FF69EE9571491924195649953194
Content-Type: application/xop+xml; charset=utf-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.urn:uuid:C91296EA5FF69EE9571491924195649953195>

<?xml version='1.0' encoding='UTF-8'?><downloadFileResponse xmlns="http://www.ebay.com/marketplace/services"><ack>Success</ack><version>1.1.0</version><timestamp>2017-04-11T15:23:15.649Z</timestamp><fileAttachment><Size>1653</Size><Data><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:urn:uuid:85F8FAD0E2DCA2E4881491924926637"/></Data></fileAttachment></downloadFileResponse>
--MIMEBoundaryurn_uuid_C91296EA5FF69EE9571491924195649953194
Content-Type: application/x-gzip
Content-Transfer-Encoding: binary
Content-ID: <urn:uuid:85F8FAD0E2DCA2E4881491924926637>

    X AFPIBulkTest1.xml  Y_o 0G ;X}@ A m u 3`b  n     R  ,|z IڴqZH Ce ~w  > }N  f  4  y   H2.f [ W uZ/»w ^PC n 93   	h 	 
   ( &4}J \?  E j   R
F   _ (ek _ 1'  ^Q Í   A  ^Q*1  e> 2    )   E  /Ig   ^   *        O 4   s   * R4  3?3 ,Dh  Vm\qCاH_|# } y   ; I_ b IO# N Cz1  L jq :R|i x  \  k  ,N " ܋ͳɽ y O Zm/SH   (* pA c D   ^')      /`  A 3ʚ % Ξ 4| , " Z   @" c V3  K Z  $    0 ە'c ŧ< v>t   W:^  Qb   X  J	 b uA   :ʦ ĺ     Bɟ   >  M ;  ` Cj@q74ݽxt   h  $ %  a G~ o> Pe} *]6  [#   3 c  ? 8n i    B    bw  n    5  x 
 ( 
  >  CM] [ 0   tN l    Ɔ* E     } e[ v      8W,4*   + e x 5F Ib@ Ly    R0n'  H6     p=FX^v  Rx Z  AE͉ C   W|Cz^   q   A h    /GH "ءg F }  j)s\  
<  SJ X 8𶛫J9 l ! lZ   % z; ءpM  $
ٹ  < 5   H3 E9 6 :   ˋpn   -Ҷ {  塏Ϡ u9
     vR %   )^ n b 5޻ c If C $2   ʪzx y?  rɸ 3a 
 4  A   ^ C5麛ٍ"XV  .D  !| , *S bgP{I  4 ydף~ y   O| q aK  K p    7 y    [K n  ; o  nab   .<    (N       H    D{LA 
0 /  ,*   *W7 +    &  z m ]]   N  <M #  Pa I C U 
 !b$c^	 \ ;      ^-   4+ ӡ  e
  {x| f E+  pW 7  Qޗ L  ^Z`{I
* \ >> . _| qv*    A   ݬ(1s  Ѧ-T? 	L  	   `	 C  M "%213i	 1)] Xl  h  )   8 }  YL Ԛ&   ^ =   >RR  ߕ  B   2#  " 
<     ]  ! -_ٓf㮈\   h  0 I  .            6GI @     I.O  T  c   
.
  ZK   ۻf咎  }  @5^  } Zp   -  "  ][_ y O  e i   s  m  '  :eS    |    fT W  i - G7{ r b   -  e     V w V  G* !r  	 N h  E  *En Y x҄ }9 %b .   o. Dt m  ~ 3  -  7  nk b"ф *- WV W x g   
a  
ye '      # 
Uz(X7                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
--MIMEBoundaryurn_uuid_C91296EA5FF69EE9571491924195649953194--

Open in new window

Microsoft AccessHTTP ProtocolVBA

Avatar of undefined
Last Comment
Dustin Stanley
ASKER CERTIFIED SOLUTION
Avatar of chaau
chaau
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Dustin Stanley
Dustin Stanley

ASKER

chaau Thanks for the help but neither way works. It still returns the same way.

I honestly don't think I have a choice. I have to accept what it puts out.

I even have in Fiddler in the options to remove all encoding but it is still the same outcome.
Avatar of Dustin Stanley

ASKER

So far I have not had any luck except with using ChillKat Software. But as far as for VBA nothing.
Avatar of Dustin Stanley

ASKER

Thanks
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo