Forum Discussion

marjo688's avatar
marjo688
New Contributor
6 years ago
Solved

Extension classpath of soapui java integration

I have seen solutions to extending the soapui classpath to custom locations using ClasspathHacker in the soapui library.

 

However this have always been implemented in the scripts where the imports are made. I wonder if this could be done in java code directly. For example I am constructing a MockRunner in java using the soapui library. In turn this MockRunner takes in a soapui project and extracts the mockservice and runs it. The mockservice operation contains a groovyscript which requires some external library imports. 

 

Now instead of defining the ClasspathHacker in the groovyscript, can I somehow do this inside the java code, attached to the operation, mockservice or project? 

  • Ended up initiating my own DefaultSoapUICore with my desired root and loading it to SoapUI as follows

     

    DefaultSoapUICore core = new DefaultSoapUICore("rootpath");
    core.createDefault();
    SoapUI.setSoapUICore(core);

     Note that I am not yet sold on my solution since playing around with the core might have unexpected effects that I am not yet aware of, but it works fine for me so far in my current implementation.

1 Reply

  • marjo688's avatar
    marjo688
    New Contributor

    Ended up initiating my own DefaultSoapUICore with my desired root and loading it to SoapUI as follows

     

    DefaultSoapUICore core = new DefaultSoapUICore("rootpath");
    core.createDefault();
    SoapUI.setSoapUICore(core);

     Note that I am not yet sold on my solution since playing around with the core might have unexpected effects that I am not yet aware of, but it works fine for me so far in my current implementation.