Forum Discussion

umeriftikhar's avatar
umeriftikhar
Occasional Contributor
10 years ago

GroovyUtils

Hi,

this function is giving no error:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )

but when i call this function:
def holder = groovyUtils.getXml( mockRequest.requestContent )

i get this error:
ERROR:An error occurred [com.eviware.soapui.impl.wsdl.mock.DispatchException: Failed to dispatch using script; java.lang.NullPointerException], see error log for details

3 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Provide more details what you are triying to achieve.
  • umeriftikhar's avatar
    umeriftikhar
    Occasional Contributor
    Hi,
    basically i am sending an HTTP request from SOAP UI and i have created a REST MockService against that request. I want to read the values of certain variables from the received request and want to return those in the response.

    here is my request:


    and i want to get the value of variable "value" from the request and want to return it in the response:


    but the line: "def holder = groovyUtils.getXmlHolder(mockRequest.requestContent) " is giving an error.

    Regards,
    Umer
  • nmrao's avatar
    nmrao
    Champion Level 3
    Sorry but it is not still clear where the script is present in the screen shots that you posted.