Hi guys,
I tried to send email but apparently the email address doesn't work. I receive a mail delivery failure. Anyway, I can explain the issue here. I created a MockService in soapUi which shall accept request and return responses. I had a groovy script to handle this. It worked as expected when started from soapUi. But then when I built the war file and deployed it in a servlet container like Tomcat, the MockService was read during initialization but was not added to the list of mock runners to be started. So when a request is sent, a "log is disabled" response is received. This same request works well inside soapUi. So I cloned the soapUi repo and modified the file MockAsWarServlet.init() method. There is a loop at the bottom which goes over all mockServices and calls start. The start method creates a mockRunner object but the return type was ignored. So I stored the mockRunner in a variable and then added it to the list if not null.
for( MockService mockService : project.getMockServiceList() )
{
logger.info( "Starting mockService [" + mockService.getName() + "]" );
if( StringUtils.hasContent( mockServiceEndpoint ) )
{
( ( WsdlMockService )mockService ).setMockServiceEndpoint( mockServiceEndpoint );
}
MockRunner mockRunner = mockService.start();
if(mockRunner != null)
{
logger.info("Added a MockRunner");
((MockServletSoapUICore) getMockServletCore()).startMockService(mockRunner);
}
}
The last part which checks if the mockRunner is not null and adds it to the MockServletCore is the part that I have added. After building soapUi with this fix and creating a war file from the same mockServlet, everything is working fine.