Forum Discussion

dschulten's avatar
dschulten
New Contributor
6 years ago

5.5.0 OpenSource: Second QUERY_MATCH mock request to same method returns 500

I have a mock server for my wsdl with a mock response for one of its methods. As long as I had only one response and used SEQUENCE, I could call the method as often as I want.

Now I wanted a second mock response with a different response body which is returned under a condition, while otherwise giving the first response.

I added the new response to the method and switched to QUERY_MATCH. I chose the first response as default, and wrote an XPath expression which chooses the second response.

Instead of giving the default response, the mock server now responds with 500 unless I send a matching request for the new response. IOW it never gives me the first response.

When I add a QUERY_MATCH for the first response as well, the mock server responds with that response exactly once, but gives me 500 for each subsequent call to the same method.

The default for QUERY_MATCH seems broken in SoapUI 5.5.0, or did I miss sth?

  • dschulten's avatar
    dschulten
    New Contributor

    in 5.5.0 OSS, if you start soapui.bat, you see lots of errors AutoDiscoveryMethodFactory ClassNotFoundException. Once I deactivated all plugins, mocking with XPath expressions kind of works again.

     

    But both in 5.2.1 and 5.5.0 a problem remains: if the xpath expression does not match, then soap ui returns 500 instead of the default response I have defined, and I see this error in the logs:

     

    2019-05-11 10:30:49,358 ERROR [errorlog] com.eviware.soapui.impl.wsdl.mock.DispatchException: Failed to find MockResponse
    com.eviware.soapui.impl.wsdl.mock.DispatchException: Failed to find MockResponse
    at com.eviware.soapui.impl.wsdl.mock.WsdlMockOperation.dispatchRequest(WsdlMockOperation.java:205)
    at com.eviware.soapui.impl.wsdl.mock.WsdlMockDispatcher.dispatchPostRequest(WsdlMockDispatcher.java:218)
    at com.eviware.soapui.impl.wsdl.mock.WsdlMockDispatcher.dispatchRequest(WsdlMockDispatcher.java:113)
    at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:142)
    at com.eviware.soapui.monitor.JettyMockEngine$ServerHandler.handle(JettyMockEngine.java:604)
    at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

    I would expect that SoapUI returns the default response instead of 500.