TL:DR => WsdlProject project = new WsdlProject();
throws
Exception in thread "main" java.lang.ClassCastException: com.eviware.soapui.config.impl.EndpointStrategyConfigImpl cannot be cast to com.eviware.soapui.config.DefaultEndpointStrategyConfig
Hello, sorry for long post, but I did really tried to solve this on my own and I couldn't.
I am learning how to use SOAP request. And for this I am using SoapUI 5.6 (Free version) and testing the free wsdl API: http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL
From the SoapUI 5.6 I have successful sending of requests and receiving responses. But I want to do that "wit Java from IntelliJ".
My task is to use com.eviware.soapui.impl.wsdl.WsdlProject.class I have read quite a few tutorials and solved a few errors. The current error that I have though, I cannot solve. It is as follows:
13:01:59,689 INFO [PluginManager] 0 plugins loaded in 1 ms 13:01:59,689 INFO [DefaultSoapUICore] All plugins loaded Exception in thread "main" java.lang.ClassCastException: com.eviware.soapui.config.impl.EndpointStrategyConfigImpl cannot be cast to com.eviware.soapui.config.DefaultEndpointStrategyConfig
I have followed this topic NoClassDefFoundError com/eviware/soapui/impl/wsdl/WsdlProject
And I have created my initial code
String endPointUrl = "http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL"; WsdlProject project = new WsdlProject(); WsdlInterface[] wsdls = WsdlImporter.importWsdl(project, endPointUrl); WsdlInterface wsdl = wsdls[0];
The error is thrown when trying to create empty WsdlProject object.
From a comment in the thread above I see that I have to implement some dependancies which as 2016 were obviously accecable but not today. So I read that I have to use foreign repository which I have added to my pom.xml file:
<repositories>
<repository>
<id>smartbear</id>
<name>smartbear repository</name>
<url>http://smartbearsoftware.com/repository/maven2</url>
</repository>
</repositories>
And I have added dependency
<dependency>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui</artifactId>
<version>5.2.1</version>
<scope>test</scope>
</dependency>
Which is now synced and I am able to import
com.eviware.soapui.impl.wsdl.*
I am sorry but I cannot seem to solve this issue:
Exception in thread "main" java.lang.ClassCastException: com.eviware.soapui.config.impl.EndpointStrategyConfigImpl cannot be cast to com.eviware.soapui.config.DefaultEndpointStrategyConfig
Any idea what could cause it?
Java 1.8 and Windows 10 64b with IntelliJ community Build #IC-212.4746.92, built on July 27, 2021
here is the class https://pastebin.com/pFSTmTsr