Forum Discussion

mmsoap's avatar
mmsoap
New Contributor
6 years ago

Mixing Mock Service and Mock Response in TestCase

 

Hi everybody,

 

I'd like to use a mockservice to reply a static response for nearly all incoming requests but for one of them I'd like to use a data contained in the received request to use it in a test Case request (typically use a data from request for a notification).

I try to declare the mock service for all request but not the one I'd like to use in my testCase hoping SoapUI will do the dispatch for this method but it is not the case.

Is there another manner to do that?

Thanks

6 Replies

  • Lucian's avatar
    Lucian
    Community Hero
    Hey,

    I don't understand what the usecase is. You want your mock service to respond differently for one of your requests?
    • mmsoap's avatar
      mmsoap
      New Contributor

       

      Hey,

       

      I try out to be more clear:

      I have two Web-Service, one used for receive requests (server),one used to send notifications (client)

      I need to use the one which send the notification (client).

      In one of my notification request, I have to use a "user id" value received in a request on the first web-service "server".

      I create a Test Suite with the first test case is the mock response for the request containing the "user id" and I transmit this value to the second test case which send the notification using this parameter.

      This works fine.

       

      But to be operational, the whole system needs that I can respond to the whole Soap Methods of the 'server' web-service (using the same path and port) during my Test Suite (and I can not predict the requests that will be sent during this time).

      I try to generate a MockService with all soap methods except the one uses in my test suite hoping that SoapUI will dispatch the requests to the MockService and to the Test suite but this does not work (my Test Suite do not receive the request and the Mock Service replies that the method is not implemented...).

       

      Is there another manner to do with this testcase?

       

       

      • mmsoap's avatar
        mmsoap
        New Contributor

        Hi Lucian,

         

        does my answer enable to clarify my use case?