title: How? SOAPUI and Groovy - send different SOAP message (with property from file) each time?
body: <p>I'm trying to use SOAPUI (4.0) to do load testing, and I want to have each SOAP request be different, with some attribute values and element values in the requests being populated from (for example) a text file.</p>
  
  <p>The SOAP message is going to be the same for each request, except for the several attribute values and element values.</p>
  
  <p>The SOAP message includes an unsigned SAML assertion, and that has some attributes that need potentially be different for each SOAP request.  Among these attributes there's one called "IssueInstant" which is basically a date/timestamp string, and an "Id" attribute, which is a unique string per request.  </p>
  
  <p>Ideally, I'd like to be able to populate that "Id" attribute value from the text file.</p>
  
  <p>I've been able to populate the IssueInstant automatically in SOAPUI, by including a small piece of Groovy code, to get the current date/time, re-format it, then store that in a property.  This Groovy code is in the startup script in the SOAPUI testcase.</p>
  
  <p>In the body of the SOAP message, I have a Subject element that I want to have populated from the text file.</p>
  
  <p>After the IssueInstant, Id, and Subject are populated, I want SOAPUI to send the request.</p>
  
  <p>So, for example, say the text file has:</p>
  
  <pre><code>id0001,cn=foo1,dc=whatever,dc=com
  id0002,cn=foo2,dc=whatever,dc=com
  id0003,cn=foo3,dc=whatever,dc=com
  </code></pre>
  
  <p>Then, when I run the SOAPUI load test, I'd like the first request to have <code>Id=id0001</code> and subject <code>cn=foo1,dc=whatever,dc=com</code>, the second request to have <code>Id=id0002</code> and subject <code>cn=foo2,dc=whatever,dc=com</code>, and the third request to have <code>Id=id0003</code> and subject <code>cn=foo3,dc=whatever,dc=com</code>, and then the load test loops back through those 3 sets of values until it ends.</p>
  
  <p>The thing that I'm having a hard time understanding is how to step through the file in the Groovy code and how the Groovy code is suppose to know which line in the text file is the next line from which to build the properties?</p>
  
  <p>I hope that this explanation of what I'm looking for is clear enough.  If not, please let me know, and I hope that someone can help.</p>