'SOAP jaxws maven plugin deployed on JBoss EAP 7.2
I have a SpringBoot 2.2.6 WebApp. I have to consume a SOAP webservices and therefore I have built the services with jaxws-maven-plugin inside my pom as follows:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<wsdlDirectory>${project.basedir}/src/main/resources/</wsdlDirectory>
<packageName>it.mypackage.ws.client</packageName>
<sourceDestDir>
${project.build.directory}/generated-sources/
</sourceDestDir>
</configuration>
</plugin>
I also have a Configuration classes as follows:
@Configuration
public class SOAPClientConfiguration {
@Value("${jks.auth.path}")
private String jksPath; // .jks client generated by .pfx generated by cert
@Value("${jks.auth.pass}")
private String jksPass; // password for .jks
private final URL url = getClass().getClassLoader().getResource("my.wsdl");
@Bean
public Services services() {
try {
SSLContext sc = SSLContext.getInstance("TLSv1.2");
sc.getClientSessionContext().setSessionTimeout(1);
KeyManagerFactory kmf = KeyManagerFactory.getInstance( KeyManagerFactory.getDefaultAlgorithm() );
KeyStore ks = KeyStore.getInstance("JKS");
ks.load( new FileInputStream(jksPath), jksPass.toCharArray() );
kmf.init( ks, jksPass.toCharArray() );
sc.init( kmf.getKeyManagers(), null, null );
Api api = new Api(url);
Services port = api.getApiPort();
((BindingProvider) port).getRequestContext().put(
"com.sun.xml.internal.ws.transport.https.client.SSLSocketFactory", sc.getSocketFactory() );
return port;
} catch (NoSuchAlgorithmException e) {
}
}
Now all works fine if I run the application with BootDashboard and the embedded Tomcat. But if I deploy the application inside my JBoss 7.2 EAP I can't manage to do any call..
Inside the log I see often apache.cxf trying to do some.. but I don't use it on my application and I don't understand why JBoss try to use it.
Is there a way to remove the cxf from jboss-deployment-structure.xml? Someone had the same problem?
How can I make it work inside JBoss?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
