19

I am analyzing SoapUI for Rest services and cant get my head around on how to post values in a request. There are options available to send the values in a querystring or header (query/template/header/matrix/plain) but I am not sure if any of these is what I need. I have tested my Rest service using a simple HTML client and calling the jquery post method and there are no problems with the service. I am curious to know if I need to provide WADL or provide the json representation of the request to get the response. At this moment SOAPUI seems to be hard to make it work for testing Rest services.

man_luck
  • 1,605
  • 2
  • 20
  • 39

3 Answers3

19

Their help section provides the answer; http://www.soapui.org/REST-Testing/understanding-rest-parameters.html section 1.3.

"If you are simulating HTML Form submits, you might want to them to use the POST method instead. If we create a corresponding REST Method using the POST (or PUT) verb you will get an option to post query-parameters in the body instead"

The screenshot describes the options to select. Its the checkbox at the bottom of the screenshot which needs to be checked; "Post QueryString".

Post options

man_luck
  • 1,605
  • 2
  • 20
  • 39
  • 6
    Ah! Thanks for this. I had given up on soapui until I found this comment. For anyone coming after, its the checkbox at the bottom of the screenshot. Checking this box will pass POST params in POST body instead of on the Query String. – Zack Oct 26 '16 at 20:44
9

You must set the query type to POST. SoapUI will automatically provide a window to enter body data: enter image description here

Yann
  • 877
  • 14
  • 25
  • What version of SOAP-UI are you using? I cannot get the JSON window to allow entering the data. – Grayson Nov 02 '16 at 18:29
  • I am using 5.2.1. not sure why you cannot edit the field. Have you set your project as a REST project (as opposed to SOAP project)? – Yann Nov 08 '16 at 01:36
2

It's actually not that difficult at all. Here's a guide on the website (or a video, if you prefer that) on how to get started. http://www.soapui.org/REST-Testing/getting-started.html

ArianJafari
  • 96
  • 1
  • 6
  • 3
    Thanks. I have already been to their help pages but they don't actually have anything regarding posting the values. The video is not playing may be because it has been disabled by network guys. This particular page does not talk about post at all. It only talks about Get request and explains the 'assertions' to validate the response I guess. I would hope so that its not that difficult but somebody finding this page as an answer which does not even talk about posting values just tells me that it will definitely not be easy. – man_luck Aug 13 '14 at 14:38