我发送一个soap请求并使用SOAPConnection接收soap响应,如下所示:
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory
.newInstance();
SOAPConnection connection = soapConnectionFactory.createConnection();
response = connection.call(message, urlEndPoint);
我需要设置主机名验证程序。如果我使用HttpsURLConnection,我可以这样做:
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
connection.setHostnameVerifier((String hostName, SSLSession ssls) -> hostName.equals("serverHostName"));
如何使用SOAPConnection实现此目的?