We help IT Professionals succeed at work.
Get Started

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

1,207 Views
Last Modified: 2017-04-20
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

Comment
Watch Question
Top Expert 2013
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE