Forum Discussion

Knowledge's avatar
Knowledge
Contributor
9 years ago

Validation of an asynchronous request to mockservice

Hi,

 

I'm running the following configuration, and i would appreciate any help / ideas on how to do it correctly.

 

1. I'm sending a soap request from soapUI to my server. This request contains a callbackURL(which is a soapUI mock service running as well).

2. My server receives the request and sends a request to the callbackURL, which is a soapUI mock service.

3. The mock service receives the request(doesn't do anything with it, it acts as some sort of notification).

 

I would like to perform a validation on the side that sent the request(from step 1). mostly because i want to add it to a test suite that will be running from command line so i need to know if it passed or failed.

 

Is it possible to add a script validation on step 1, and the script will check what did the mock service received?

Any other ideas on how to do it?

 

Any help will be very appreciated, i'm a bit stuck now.

 

Thanks in advance.

  • Hi, 

     

    Are you still working on this?

     

    It sounded like you have something like this:

     

    SoapUI TestStep -> Your service

    Your Service -> Mock (where you want to validate the payload)

     

    Is it that you want to validate the callback inside the mock? If so, rather than using a mock, had you considered a SOAP Mock Request TestStep? (these can use assertions)

     

    Regards,

    Rupert

  • Ok, hopefully we can work through it.

     

    So, to configure it you need to supply a port and context to listen on. Then when the TestCase runs, the mock response test step will start to listen on localhost+port+path specified and wait until it receives the callback request. You set the path & port to match the call back url that is passed to your service in the original request. When a the mock response test step receives a request it will despatch a response (as specified in the mock response test steps editor on the right) - i dont think there's a way to prevent this response.

     

    Does that make more sense?

     

    Regards,

    Rup

  • No one have any idea how to do it?

    I'm really stuck and would appreciate any help...

     

    Thanks

    • rupert_anderson's avatar
      rupert_anderson
      Valued Contributor

      Hi, 

       

      Are you still working on this?

       

      It sounded like you have something like this:

       

      SoapUI TestStep -> Your service

      Your Service -> Mock (where you want to validate the payload)

       

      Is it that you want to validate the callback inside the mock? If so, rather than using a mock, had you considered a SOAP Mock Request TestStep? (these can use assertions)

       

      Regards,

      Rupert

      • Knowledge's avatar
        Knowledge
        Contributor

        Thanks for your reply. Yes, I'm still working on this.

         

        What is a SOAP Mock Request TestStep and how do i do it?

         

        Basically the flow you wrote is correct, but I need assertions so i wanted to know if there is a way to validate the request the mock received in the SoapUI TestStep assertion. 

        If you can please explain how to do the mock test step I can check if it's what i need.

         

         

        Thanks a lot in advance.