Showing posts with label Testing. Show all posts
Showing posts with label Testing. Show all posts

Tuesday, July 12, 2011

Add dynamic datetime to SoapUI

Sometimes you want to add a simple dynamic datetime to soapUI (the best SOAP tester in the world!). You can do that easily by using the String.format command. Below is an example which returns the time in the following format: 2011-07-12T09:06:11+01:00

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:smar="">
   <soapenv:Body>
      <smar:DateTest>
         <smar:request>
            <smar:Date><![CDATA[${=String.format('%tFT%<tT', new Date() + 10)}+01:00]]></smar:TransactionDate>
         </smar:request>
      </smar:DateTest>
   </soapenv:Body>
</soapenv:Envelope>

Now SOAP testing becomes even more fun!