Just started using soapUI and I like it a lot.
In a particular case using REST, I’m receiving serialized object.
I would like :
-
to retrieve the serialized byte array and transform it into a Java object
-
re-transform the java object into an XML response (using JAXB)
so it can be human readable.
Is this feasible?
Be sure to consider using XML serialization (e.g. XStream) instead of binary one to avoid version compatibility problems before using the next solution:
Import your Java class to SoapUI groovy script (as described there) or re-define your Java class in Groovy code with
Serializableinterface implemented:Use
ObjectInputStreamandclassLoaderto load deserialize objects into object:Use
ObjectOutputStreamto serialize updated objects and save them to an XML response: