【学习笔记】使用idea自带生成webservice客户端client的问题

导入web service的证书到本地jdk的证书库里

报错
com.sun.xml.ws.client.ClientTransportException: HTTP 传输错误: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present
原因
ip的问题,如果是域名就没问题。
解决方案
jdk1.8 的话
在代码里面加入HttpsURLConnection.setDefaultHostnameVerifier((hostname, session) -> hostname.equals(“10.173.235.52”));

解决的链接
http://stackoverflow.com/questions/10258101/sslhandshakeexception-no-subject-alternative-names-present

报错
由于 accessExternalSchema 属性设置的限制而不允许 ‘file’ 访问, 因此无法读取方案文档 ‘xjc.xsd’。
解决方案
Create a file named jaxp.properties (if it doesn’t exist) under /path/to/jdk1.8.0/jre/lib and then write this line in it:
javax.xml.accessExternalSchema = all
解决的链接
http://stackoverflow.com/questions/23011547/webservice-client-generation-error-with-jdk8