Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Script to generate and return UUID

LegacyForum
LegacyForum Posts: 1,664 ✭✭
edited December 2016 in SOAtest
The script below invokes the SOAPUtil.generateUUID() method to return a string containing a univserally unique ID (UUID)

CODE
###  Name:    generateUUID
###  Author:  Mark Carlson
###  Date:    09/15/2006
###
###  Description: Uses Parasoft API to generate universally unique ID (UUID)
###
###  Usage:  Returns string containing uuid
###
from soaptest.api import *
from com.parasoft.api import *

def generateUUID():
 uuid = SOAPUtil.generateUUID()  #invokes generateUUID API method to get UUID
#  Application.showMessage("UUID = " + uuid) #output uuid for debugging
 return uuid
#  return SOAPUtil.getXMLFromString([str(uuid)]) #uncomment to return uuid as an XML string
Tagged: