Forum Discussion

hookem's avatar
hookem
New Contributor
14 years ago

Passing Unique Identifier

I'm new to soapUI. I've been given 3 ways by which a unique identifier is created. 1) via a java script (jar file) 2) via a groovy script, and 3) a service URL. I need to pass this unique identifier to an endpoint, via Layer7(ESB), returning the UID back to soapUI. What is the most effective way to complete this action and where do I begin?
  • Hello,

    each of these three ways sounds fine - regardless of which one you choose,
    the process of sending value to endpoint should be rather straightforward,
    but it depends on the type of request.

    Did you have the chance to look at some of our tutorials already ?
    If you need more help, please add some more information so we are able to help you further.

    Regards,
    Vladimir
    SmartBear Software
  • hookem's avatar
    hookem
    New Contributor
    These scripts were used seperately and work fine.

    import java.util.UUID

    String uid = UUID.randomUUID().toString();

    // without '-' (32 char)
    //String uid = UUID.randomUUID().toString().replaceAll("-", "");


    // Set the Project Level Property

    testRunner.testCase.testSuite.project.setPropertyValue("GlobalUUID", uid)




    ************************************
     


    def newToken = "curl http://servername:port/eimssaml -u username:password".execute().text

    testRunner.testCase.testSuite.project.setPropertyValue("GlobalSecurityToken", newToken)