JAVA中SOAPConnection的SSL设置

时间:2018-04-27 09:40:39

标签: java ssl soap

我发送一个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实现此目的?

0 个答案:

没有答案