Forum Discussion

pepo's avatar
pepo
Occasional Contributor
17 years ago

MockService Options – Docroot option

I want to mock http/REST request in SoapUI 2.5.
In previous forum topics you mentioned possibility to do static mocking by Docroot option.
I found only next description in documentation:
“Docroot - path to a local folder that should be used to serve files for GET requests to the MockService path”
How does it work?
Should these files in Docroot folder use any special name convention?

I created file with static response in folder c:\SoapUIResponses.
I named this file as GET part of REST request.
I set c:\SoapUIResponses but I got next error when I called this mock from REST service test:
...
  Server com.eviware.soapui.impl.wsdl.mock.DispatchException: com.eviware.soapui.impl.wsdl.mock.DispatchException: java.io.FileNotFoundException: C:\SoapUIResponse (Access is denied)
...

4 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi

    the folder specified will be used as a root folder for returning files from the file-system, so if you put a file in the c:\SoapUIResponses folder named "test.html" and then call your mockservice with a GET request to http://localhost://test.html it should return the test.html file.

    regards!

    /Ole
    eviware.com
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    sorry, not currently. An easy fix which could be in the upcoming nightly build would be to "convert" the query-string into the filename in some way, for example by replacinog non-allowed characters with '_' and putting the extension last (in your case that would be test_par1=val1.html). Would that be ok (for now)?

    regards,

    /Ole
    eviware.com
  • Hello,

    I am wondering if this can be done using the lastest version of SoapUI 4.5.0 open source?

    I want to be able to add parameter and also parsing the http header information for authentication purpose.

    Is it possible yet to add script to handle rest request?

    --Deen