2013-05-01 81 views
0

在我的Wicket应用程序中,我想用soap将数据发送到wsdl-endpoint。为了做到这一点,我在Eclipse中制作了一个动态Web项目(使用Axis2)。连接到端点时出现错误。错误是:SSLHandshakeException动态web项目java

造成的: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)?有人可以向我解释这是如何工作的吗?

谢谢!

回答