Ask a Question

How to access soapUI request xml from mockResponse script

Apoorva6
Frequent Contributor

How to access soapUI request xml from mockResponse script

I need to access my request in mock service script which has log, context, requestContext, mockRequest and mockResponse variables that can be used. Please let me know how can i access the request.

Note: I cannot create separate test suite or test case for this and hence i need to access request xml in mock service script only.

4 REPLIES 4
Apoorva6
Frequent Contributor

Hi,

 

Any update on above Q please ?

I am using this, log.info context.expand('${#Request1}') , its printing null. Any idea ?

What does it show for the following statement in the Script Despatcher?

log.info mockRequest


Regards,
Rao.
Apoorva6
Frequent Contributor

Hi Rao, with that I have below response:

 

Fri Mar 24 20:47:14 IST 2017:INFO:com.eviware.soapui.impl.wsdl.mock.WsdlMockRequest@57aeff

Apoorva6
Frequent Contributor

Hi,

 

I am able to get the request with below in dispatch script

 

def requestBody = mockRequest.getRequestContent()
log.info "Request body: " + requestBody

 

Thank you

cancel
Showing results for 
Search instead for 
Did you mean: