Forum Discussion

ckorakidis's avatar
ckorakidis
New Contributor
12 years ago

Problem with path of xsds on linux

Hi,

I have deployed as war some mocks in my local tomcat and I have a problem with paths used.

The error I'm getting in logs is
[AbstractWsdlDefinitionLoader] Failed to find [file:\home\user\path\INSQBWebServiceCommonFault.xsd] in InterfaceCache
which seems to be suitable for windows, instead linux.

After some investigation, I discovered that possibly it could be related to
InterfaceCacheDefinitionLoader.loadXmlObject( String url, XmlOptions options )


If you compare these two versions:

1: http://www.massapi.com/source/soapui-4.0.0/src/java/com/eviware/soapui/impl/support/definition/support/InterfaceCacheDefinitionLoader.java.html

2: http://www.soapui.org/xref/com/eviware/soapui/impl/support/definition/support/InterfaceCacheDefinitionLoader.html

You'll find out that in the first, it is
url = url.replace( '/', '\\' );
while in the second
url = url.replace( '/', '//' );


Possibly this is the reason of the problem, but it could be something else.

Any ideas on how to fix it?

Thanks.

6 Replies

  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    hi,

    the code displayed on soapui xref is really not up to date whereas it is supposed to be the code of the last version, see the class header which is 'soapUI, copyright (C) 2004-2010 eviware.com'

    The current code for the class you mentioned can be seen here: https://github.com/SmartBear/soapui/blo ... oader.java

    What soapui version are you using?
  • ckorakidis's avatar
    ckorakidis
    New Contributor
    Hi,

    Thanks for the quick response.

    I know that it's old, the other one I mentioned looks the same as that of github, which is the most recent and for some reason it replaces the '/' with '\\'

    I have the version 4.5.2 which replaces the '/' with '//' as it is shown in the github version. I found the other one from 2010 and thought that it has been changed by mistake in the last version, resulting in changing the paths with '/' to paths with '\', which is my current issue if you see the log messaage I posted.
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    ok, it seems the code has been modified between soapui 3.6.1 and 4.0.0
    I think i you pass through this portion of code at runtime, it is because the xsd has not been found previously (see the for loop with the return just before the 2 if File.separator conditions). The last 2 ifs are a final attempts to access to the file from the HD when the defined path uses wrong file separator (for example, the projet uses windows separator and you have imported it on linux)

    I suspect the following happen: in your wsdl files used during import in soapui, xsd are referenced with absolute path (not relative) so they can not be resolved at 1st attempt (the for loop), then try with the file separator substitution and generate a wrong path to the xsd
    A user report me that this could be an issue when using that kind of configuration with the mock as war feature (ie servlet runner), see https://github.com/redfish4ktc/maven-so ... t-16164542

    Can you check your wsdl please and tell me if you are in this situation?
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    hifist could you provide the tomcat logs please and your soapui project please (if it does not contains sensible data)?
    I need this to reproduce the problem