Forum Discussion

Perchishka's avatar
Occasional Contributor
7 years ago

How to trim white space after XMLParser

Hello!   I have an xml.file  and I need to generate random UUID and Date for every request. So I decided to write a groovy script: TimeZone.setDefault(TimeZone.getTimeZone("Europe/Moscow")); def...
  • nmrao's avatar
    7 years ago

    I believe that this question was earlier posted and not visible somehow. Now visible again, it seems.


    Any ways, if your object is just to add UUID and date only as shown in the request there, then you do not even require the current Groovy Script step there before Soap Request Test step.


    You can directly achieve that within request step itself by the use of in-line script as shown the below request. You can disable groovy step and update the request as below:


    <?xml version="1.0" encoding="UTF-8"?>
    <SmsSubscriptionsTarifficationNotifies xmlns="">
          <TransactionId>${= UUID.randomUUID()}</TransactionId>
          <SubscriptionId>${= UUID.randomUUID()}</SubscriptionId>
          <ContentId>${= UUID.randomUUID()}</ContentId>
          <AttemptDate>${= new Date().format("yyyy-MM-dd'T'HH:mm:ss.SSSZ")}</AttemptDate>

    Hope this helps.