Keane_India_Lim
14 years agoNew Contributor
How to modify the xml on onRequestscript() in SOAP UI
Here is the code which we wrote in onRequestscript
But this script changes our XML entirely... We want to modify an existing XML(something.xml)..
We were not able to modify the xml so we thought of changing the xml instead.But according to some business logic its wrong... So how can we modify the xml in onRequestscript?
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
path = "D:\\Service\\something2.xml";
log.info("path = "+ path);
if (mockRequest.method == "POST" )
{
mockRunner.returnFile( mockRequest.httpResponse, new File(path))
return new com.eviware.soapui.impl.wsdl.mock.WsdlMockResult(mockRequest)
}
But this script changes our XML entirely... We want to modify an existing XML(something.xml)..
We were not able to modify the xml so we thought of changing the xml instead.But according to some business logic its wrong... So how can we modify the xml in onRequestscript?