Software Development

Upload file using SOAP UI

Upload file using SOA UI

This article demonstrates how to upload file to a RESTful web service. Using SoapUI for testing web services may hasten the development of an application since we do not need to wait for a working UI. We’ll use SoapUI OpenSource 5.2.1. This is a free version and can be downloaded from

https://www.soapui.org/downloads/soapui.html

Configure a Request

After you created a request, you may now configure it as shown on the image below. There are 5 items to take note of.

  1. The method
    You may specify either POST or PUT.
  2. Request Parameter Value
    When uploading a file instead, the text value needs to be in a specific format, i.e., file:<PATH_AND_FILE_NAME>
  3. Media Type
    This must be set to “multipart/form-data”
  4. Post QueryString
    This must be ticked
  5. Attachments
    You need to attached the file referred to by the Request Parameter Value (item 2). Take note of the “Cached” column. When you attach a file, SoapUI asks you whether or not to cache the file. If an attachment is cached, a copy of the original file is temporarily saved and sent everytime the request is sent to the RESTful web service.

turreta-soap-ui_0

Loading

Got comments or suggestions? We disabled the comments on this site to fight off spammers, but you can still contact us via our Facebook page!.


You Might Also Like