jpdunn
13 years agoOccasional Contributor
Testing with REST, different message bodies?
I'm a fairly new SOAPUI Pro user and need to create a test that sends a REST request multiple times using a POST method with a different message body (or payload) on each iteration. The payload type will always be xml. I'm not sure how to do this or if a groovy script is the best way to do it. Is a property transfer better? Further details below... Help is appreciated.
I thought I would do this in a groovy script, since I wrote a script before that dealt with SOAP messages but this is different. Without an initial message body, I can't retrieve an XMLHolder. I've considered using a root element common to every payload but I don't know how to insert a large block of xml other than as a string. This is a problem because I don't want to embed the block as CDATA. Also, I'm not sure how to remove a large block of xml from the request body.
I thought I would do this in a groovy script, since I wrote a script before that dealt with SOAP messages but this is different. Without an initial message body, I can't retrieve an XMLHolder. I've considered using a root element common to every payload but I don't know how to insert a large block of xml other than as a string. This is a problem because I don't want to embed the block as CDATA. Also, I'm not sure how to remove a large block of xml from the request body.