I have a SoapUI project (named projectX) with a test case. When the testcase is run from the GUI, it works.
When run with SoapUI-5.6.0\bin\testrunner.bat it works.
When run from a Java program that uses the class com.eviware.soapui.tools.SoapUITestCaseRunner method run() then it works when run by itself, but if run as a series of 4 SoapUI projects, it fails with "Missing operation [operationXyz] in wsdl definition".
I currently use soap jar version 5.1.0. Using 5.1.3 does not help. I will try never versions in the future. (it is not simple as it is an old legacy project using an old version of Java, where the new soapui jars do not run)
Any idea why is this happening?
The Java code is basically:
SoapUI.getSettings().setBoolean(SSLSettings.CLIENT_AUTHENTICATION, true);
SoapUI.getSettings().setString(SSLSettings.KEYSTORE, "src/test/resources/xxxxxx.p12");
SoapUI.getSettings().setString(SSLSettings.KEYSTORE_PASSWORD, "12345678");
SoapUI.saveSettings();
SoapUITestCaseRunner runner = new SoapUITestCaseRunner();
runner.setProjectFile("src/test/resources/project_1.xml");
runner.setProjectProperties(new String[] { "foo="+foo, "bar="+bar});
runner.setOutputFolder("target/soapui/project_1");
runner.setJUnitReport(true);
runner.setExportAll(true);
runner.setPrintReport(true);
runner.run();
// then repeat the exact same for project_2, i.e. just a different argument to setProjectFile()
A web search for this error finds just a couple of hits, with no resolution.
Running those test suites with soapui-maven-plugin version 5.1.3 works the same:
It seems project 2 (but not project 1) leaves something behind that causes projectX to fail. Whatever it is, it lives only for the duration of the test. If the test is restarted with only projectX, then it works.
Later I discovered that the cause is that SoapUI somehow caches WSDL per their (WSDL) URL and those projects had the same WSDL URL (but different actual WSDL content).
The problem occurs also in SoapUI 5.6.0 and 5.8.0 GUI: if a project is opened or tests from it executed, their WSDL gets "loaded" and later used even for other projects that have a different WSDL stored.
Change the WSDL URL (by editing the Soapui project XML file) in those project to be different. These places:
<con:interface definition="https://localhost:8444/foo/bar?wsdl" ... >
<con:definitionCache ... rootPart="https://localhost:8444/foo/bar?wsdl">
<con:part> <con:url>https://localhost:8444/foo/bar?wsdl</con:url>
Just changing the port number in the URL to something not used anywhere else is enough.