Forum Discussion
SmartBear_Suppo
Alumni
17 years agoHi p_nevilleuk,
Why don't you instantiate a new string from a byte array?
You can then use the resulting string to set a property or pass it to whatever soapUI API method that expects a string object:
Groovy behaves pretty much as Java which means you can use in Groovy whatever classes and methods are available in Java. That's why you can use in Groovy the String(byte[]) constructor that comes with the Java SDK.
The main differences between the two lie are the fact Groovy is a dynamic language and that it has optional typing. Both features just give you more freedom.
Cheers!
/Nenad Nikolic a.k.a. Shonzilla
Why don't you instantiate a new string from a byte array?
You can then use the resulting string to set a property or pass it to whatever soapUI API method that expects a string object:
byte[] aesBytes = [0x41, 0x45, 0x53, 0x20, 0x72, 0x75, 0x6c, 0x65, 0x5a]
log.info "AES bytes: $aesBytes"
String aesString = new String(aesBytes)
log.info "AES string: $aesString"
Groovy behaves pretty much as Java which means you can use in Groovy whatever classes and methods are available in Java. That's why you can use in Groovy the String(byte[]) constructor that comes with the Java SDK.
The main differences between the two lie are the fact Groovy is a dynamic language and that it has optional typing. Both features just give you more freedom.
Cheers!
/Nenad Nikolic a.k.a. Shonzilla