Ask a Question

Getting Error while trying to run soap xml using java

New Contributor

Getting Error while trying to run soap xml using java

Hi, I am using maven-soapui-plugin 4.5.1 and I want to run a particular test step. I am using below code:

        WsdlProject abc = new WsdlProject(projectXMLPath);
        WsdlTestSuite wsdlTestSuite = abc.getTestSuiteByName(testSuiteName);
        WsdlTestCase wsdlTestCase = wsdlTestSuite.getTestCaseByName(testCaseName);
        WsdlTestCaseRunner wsdlTestCaseRunner = new WsdlTestCaseRunner(wsdlTestCase,new StringToObjectMap());
        WsdlTestStep wsdlTestStep = wsdlTestCase.getTestStepByName(testStepName);;

Few things -
1. The project xml has 2 test suites, first test suite has the steps and second test suite has the library functions. In SoapUI they are coded as below:

First Test Step Script (Given a request with a valid address is made) from first Test Suite is as below:

    def proj= null
    def workspace = testRunner.testCase.testSuite.project.getWorkspace();

    proj= workspace.getProjectByName("Calling")

    def testCase = proj.testSuites["Library"].testCases["Successful Calling Steps" ]
    testRunner.testCase.setPropertyValue( "addressLine1", "xxxx" )
    testRunner.testCase.setPropertyValue( "city", "xxxx" )
    testRunner.testCase.setPropertyValue( "state", "xx" )

    def testStep = testCase.getTestStepByName("Given a request with a valid address is made")

    def runner = null
    runner =, context)

2. Second Test Script from Library Test suite has the actual REST request, end point for the webservice and webservice authentication.

3. If we execute the first test step in first test suite in SOAPUI, it internally calls the test step in Library replaces the variable values and makes a REST call to get a response. This works fine in SOAPUI, but when we are calling the first test step by run method in JAVA, it is failing with below error.

Exception in thread "main" java.lang.NoClassDefFoundError: com/jniwrapper/PlatformContext
 at com.eviware.soapui.SoapUI.isJXBrowserDisabled(
 at com.eviware.soapui.SoapUI.isJXBrowserDisabled(
 at com.eviware.soapui.impl.wsdl.submit.filters.HttpAuthenticationRequestFilter.filterAbstractHttpRequest(
 at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterRequest(
 at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(
 at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(
 at$ Source)
 at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(
 at MyClass.simpletest1(MyClass.groovy:109)
 at test.main(
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(
 at java.lang.reflect.Method.invoke(
 at com.intellij.rt.execution.application.AppMain.main(
Caused by: java.lang.ClassNotFoundException: com.jniwrapper.PlatformContext
 at Method)
 at java.lang.ClassLoader.loadClass(
 at sun.misc.Launcher$AppClassLoader.loadClass(
 at java.lang.ClassLoader.loadClass(
 ... 22 more


What may be missed here that I need to add to resolve the issue? Please help.


 After further debug, I found that SoapUI.class -> line 734 is coded as below:


return disable.equals("true")?true:(getSoapUICore() != null && getSettings().getBoolean(UISettings.DISABLE_BROWSER)?true:(!disable.equals("false") && allowNative && (BrowserType.Mozilla.isSupported() || BrowserType.IE.isSupported() || BrowserType.Safari.isSupported())?false:!disable.equals("false") && !PlatformContext.isMacOS() && "64".equals(System.getProperty(""))));

 and the PlatformContext class import is failing.


import com.jniwrapper.PlatformContext;

Please check and reply. 

New Contributor

I used below dependency instead of maven-soapui-plugin 4.5.1 and it fixed the issue.




Champion Level 2

Missing the dependent library.


Have you tried the solution provided by community member? Did it solve?


Also there is any way to run the soapui project using java as mentioned in the 2nd answer of the following link

Check it out.

New Contributor

Yes I used the latest Maven dependency and it resolved the issue.

Showing results for 
Search instead for 
Did you mean: