Forum Discussion

lenenberg's avatar
lenenberg
Occasional Contributor
12 years ago

"Resource Root" property ${projectDir} and relative path

"Resource Root" property ${projectDir} and relative path for WADL file, how to configure properly?

It is written that it is possible to use relative paths for data files.
I created simple project.
I set "Resource Root" property to ${projectDir}

I import WADL file and change its WADL property to relative path, but Schema Compliance for this wadl still disabled when i use it in assertion of REST TestRequest.

Here is my project, logs file and pictures.

4 Replies

  • Hello all,

    I think I'm having a similar problem, if not the same. All I want to do is to have a SoapUI project that is shared among different developers. So all paths must be relative.

    I tried setting my WADL file as "file://${projectDir}/../../target/site/wsdocs/application.wadl"

    At a first glance it worked: The interface was created, and every available request in the WADL has been found and added. Other configurations as endpoints were also found.

    But when I'm trying to create my first step, and SoapUi tries to fetch the request definition, I see the following error popping out on my terminal:

    [tt:zn7vwuks]12:03:08,249 ERROR [SoapUI] An error occured [com.eviware.soapui.impl.support.definition.support.InvalidDefinitionException], see error log for details
    java.net.UnknownHostException: ${projectDir}
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
    at sun.net.NetworkClient.openServer(NetworkClient.java:118)
    at sun.net.ftp.FtpClient.openServer(FtpClient.java:488)
    at sun.net.ftp.FtpClient.openServer(FtpClient.java:475)
    at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:270)
    at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:352)
    at java.net.URL.openStream(URL.java:1010)
    at com.eviware.soapui.impl.wsdl.support.wsdl.UrlWsdlLoader.handleFile(UrlWsdlLoader.java:194)
    at com.eviware.soapui.impl.wsdl.support.wsdl.UrlWsdlLoader.load(UrlWsdlLoader.java:124)
    at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlLoader.loadXmlObject(WsdlLoader.java:121)
    at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getDefinitionParts(SchemaUtils.java:535)
    at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.getDefinitionParts(SchemaUtils.java:524)
    at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionCache.update(AbstractDefinitionCache.java:97)
    at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:236)
    at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
    at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
    at java.lang.Thread.run(Thread.java:619)
    12:05:25,541 ERROR [WsdlLoader] Failed to load url [file://${projectDir}/../../target/site/wsdocs/application.wadl][/tt:zn7vwuks]


    As consequence, I can't have the definitions automatically filled for me. Having the definitions make everything much more productive.

    Can anybody help me? Should I file a bug perhaps? Sorry if what I'm asking has already been answered, but I'm quite a newbie with SoapUI.

    Thanks!
  • nmrao's avatar
    nmrao
    Champion Level 3
    Just wanted to confirm where ${projectDir} is set?

    Have you tried using project's custom properties?
    Define a property - as you mentioned projectDir and set your local path.
    Then use as ${#Project#projectDir}
    • DouglasY's avatar
      DouglasY
      Occasional Contributor

      I know this is old, but I see no answers. Since I cannot find my answer, I'll probably have to formulate a new question, but I wanted to point out to the last commenter, nmrao, that ${projectDir} is mentioned in the ReadyAPI documentation...  here's a link to one page I found today:

       

      https://support.smartbear.com/readyapi/docs/configure/workspaces/properties.html

       excerpt:


      To use the file path relative to the project directory, use ${projectDir}\data. For example:

      D:\projects\webservice\data\testdata.xls

      To use the file path relative to the directory that contains the workspace file, use ${workspaceDir}\data. For example:

      D:\projects\data\testdata.xls


       

      • PaulMS's avatar
        PaulMS
        Super Contributor

        Were you also using a relative path for WADL with ${projectDir}?

         

        The project folder was resolved correctly when testing a groovy script like this

         

        log.info context.expand('${projectDir}')
        log.info context.expand('${workspaceDir}')