在我的 Wicket 应用程序中,我想使用肥皂将数据发送到 wsdl 端点。为此,我在 Eclipse(使用 Axis2)中创建了一个动态 Web 项目。连接到端点时出现错误。错误是:
原因:javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径
端点需要用户名和密码,具有抢先连接。
这是我的代码:
Deliver deliver = new Deliver();
XmlDataList dataList = new XmlDataList();
dataList.addXmlData(XML);
deliver.setXmlDataList(dataList);
Stubstub = new Stub();
Authenticator basicAuthenticator = new HttpTransportProperties.Authenticator();
List<String> schemes= new ArrayList<String>();
authSchemes.add(Authenticator.BASIC);
basicAuthenticator.setAuthSchemes(schemes);
basicAuthenticator.setUsername("UName");
basicAuthenticator.setPassword("Pwd");
basicAuthenticator.setPreemptiveAuthentication(true);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthenticator);
如何设置连接到 wsdl (https) 的抢占条件?有人可以向我解释这是如何工作的吗?
谢谢!