Forum Discussion

sgsoapuser's avatar
sgsoapuser
Occasional Contributor
13 years ago

SOAP UI REST API GET

Hi,

I am new to SOAP UI. I am using version 4.6.0. I am making REST API call and using GET method to get csv zip file. In the REST response I dont see any attachment.
However I see something like this in response body: <data contentType="application/zip" contentLength="1871">UEsDBBQACA...................</data>.

Type: Response,Media-type: application/zip, status code: 200 and QName: data.

how can i get the attachment in REST API response? Appreciate your help.

3 Replies

  • In the response editor, there's an "Attachments" tab at the bottom. Do you see anything there?

    Thanks,
    Michael Giller
    SmartBear Software
  • sgsoapuser's avatar
    sgsoapuser
    Occasional Contributor
    Hi Michael ,

    I dont see anything in "Attachments" tab at the bottom of response editor.
    I believe the data is encoded in response body and may be decode is required. I am not sure as I am new to soap ui.

    this is the response body:

    <data contentType="application/zip" contentLength="2792">UEsDBBQACAAIAO+/vVo4QwAAAAAAAAAAAAAAAAsAAABBY2NvdW50LmNzdu+/vVtbbxvvv70Ofj/vv73vv70Pee+/vUIYcu+/vW9y77+9Hu+/vUVb77+9be+/vT4aa2kdbyzvv73vv70q77+977+977+9D9eyNRfvv70iE++/vUBS77+977+9ce+/ve+/vSPvv71X77+977+9eBjvv73Fr++/vWvvv73vv73vv73vv73vv73vv73vv704TO+/vWpa77+9Oe+/ve+/vd+277+977+977+977+977+90K/vv73fte+/ve+/ve+/ve+/vXHvv70bRO+/vWxoOu+/ve+/ve+/vTQu77+9Mu...and it continues ...</data>

    Any suggestions would be helpful.

    Thank you.
  • It looks like your response isn't some XML/JSON response with an attachment, but just a zip file itself.

    So you would have to use Groovy as shown here: http://stackoverflow.com/questions/4656 ... i-response

    or maybe:
    1) Download Notepad++
    2) Use the MIME Tool Plugin to convert
    2a) Cut and paste the binary data from the web services call into a new file
    2b) Plugin -> MIME Tool -> Base64 Decode
    2c) Save the file as Zip

    Thanks,
    Michael Giller
    SmartBear Software