Best way to repeatedly invoke a WebService which takes JSON as the input?
I am trying to use SoapUI to repeatedly invoke a Web Service (which is a Test Step), but supply a different application/json as the media type each time. I do not know the best way to perform this, so my approach was:
- Create a Groovy script which contains an array of JSON objects
- Create a Test Step property.
- Loop the array and in each loop:
- set the property to be the current JSON object
- call the Test Step which invokes the web service. The application/json of the Test Step has a reference to the property
However this fails, because a property can only take a String and not take a JSON object.
Am I approaching this problem incorrectly? Is there a better way to parameterise calling a Test Step? I considered invoking the Web Service directly from Groovy, but felt that the strengths of asserting an existing Test Step (with all of its assertions) was the correct way of doing this.