Reputation: 31
We are using spring-ws-core-2.2.3.RELEASE.jar
for spring web service connections. In order to bypass/override invalid host (source and sender are not the same) for testing purposes, I am trying to do this:
public void setWebServicesTemplate(WebServicesTemplate template) {
HostnameVerifier verifier = new NullHostnameVerifier();
HttpsUrlConnectionMessageSender sender = new HttpsUrlConnectionMessageSender();
sender.setHostnameVerifier(verifier);
template.setMessageSender(sender);
this.template = template;
}
public class NullHostnameVerifier implements HostnameVerifier {
public boolean verify(String hostname, SSLSession session) {
return true;
}
}
I am not able to find this class in my version of spring-ws-core-2.2.3.RELEASE.jar
, however I am able to see it in the previous and higher versions of the .jar.
Upvotes: 3
Views: 3591
Reputation: 11
You have to add the following dependency as this class is part of spring-ws-support:
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-support</artifactId>
<version>2.2.3.RELEASE</version>
</dependency>
Upvotes: 1