Forum Discussion

GrahamH's avatar
GrahamH
New Contributor
8 years ago

Mock service Docroot property: SoapUI changes Windows LAN drive path to ../, does not serve files

I'm using SoapUI 5.2.1 on Windows 10.

 

My SoapUI project file is in a LAN drive path that contains spaces, like this:

 

Z:\very\long path\with\spaces\wsdl\soapui-project.xml

 

I keep a web page, for testing the SoapUI mock service defined by that project, in the parent directory:

 

Z:\very\long path\with\spaces\index.html

 

I want the mock service to serve that web page via the mock service Docroot property.

 

In the SoapUI SOAP MockService Options dialog, if I click the Browse button next to the Docroot text box, navigate to that LAN directory that contains index.html, and then click Open, the Docroot text box contains the expected path:

 

Z:\very\long path\with\spaces

 

However, when I click OK on the options dialog, and then re-open the options dialog (by clicking the "cog" toolbar icon of the MockService window), the Docroot text box shows the following relative path:

 

../

 

and, when I start the mock service, the index.html file doesn't get served. Which is what prompted me to write this message.

 

I can kinda/sorta see why SoapUI might replace the absolute path I specified with a relative "parent directory" path (../), because the path I specified is the parent directory of the SoapUI project. Or perhaps that's a coincidence; a red herring.

 

However, when stepping through what I did previously, to document it for this message, re-opening the options dialog no longer shows "../"! Instead, the Docroot text box is empty.

 

This is still a problem, but it's frustrating, because it's a different problem than the one I first saw. I can't seem to reproduce getting that "../" in the Docroot text box, even though I recall reproducing it several times yesterday! I must be doing something different.

 

Either way - ../ or blank - the Docroot property doesn't appear to like me specifying a path like this:

 

Z:\very\long path\with\spaces

 

Is it because:

  • It refers to a LAN drive rather than a local drive?
  • The path contains spaces?
  • The path separators are (Windows-style) back slashes, rather than (forward) slashes?

As a workaround, I've copied the index.html file to a directory on my local C: drive, with no spaces in the path, and specified that as the Docroot:

 

C:\mocksoap\servicename

 

When I exit the Browse dialog, the Docroot text box shows the path as above, with backslashes. However, when I visit the options dialog later, I see that SoapUI has changed the backslashes to forward slashes:

 

C:/mocksoap/servicename

 

I'm not surprised by this replacement: I use various other XML tools on Windows that require me to specify paths using forward slashes, not backslashes.

 

That cuts out one possibility: specifying backslashes in the path doesn't seem to be a problem.

 

What was the problem with my original Docroot property value: that is, the LAN drive path with spaces, that happens to be the parent directory of the directory that contains the SoapUI project file?

 

I'd much prefer to have the Docroot property refer to the LAN directory, rather than having to keep a copy of the index.html file on my local hard drive.

 

No RepliesBe the first to reply