我们有一个外部SOAP服务,下面的工作
<bean id="WSACallbackKlen" class="nbr.ei.util.LctionCallback">
<constructor-arg index="0" value="http://serviations.bnst.n/toezicht/ka/km/KkService/tnRequest"></constructor-arg>
<constructor-arg index="1" value="http://servtions.bnst.n.tst.st3/toet/ka/km/Kervice"></constructor-arg>
</bean>
<int:chain input-channel="kkChannel" output-channel="dest-channel">
<ws:header-enricher>
<ws:soap-action value="http://servicons.belt.n/toet/ka/kk/KKserice/tnRequest"/>
</ws:header-enricher>
<ws:outbound-gateway uri="http://bb-k1.ts.nst.n/wsb/router" request-callback="WSACallbackKlen" message-sender="kkMsageSender"/>
</int:chain>
它被设置为安全的,因此在出站网关中将URI更新为
“URI=”
HTTPS
://bb-k1.ts.nst.n/wsb/router“
使用Spring上下文进行集成测试时出错-
org.springframework.ws.client.WebServiceIOException: I/O error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:561)
at org.springframework.integration.ws.SimpleWebServiceOutboundGateway.doHandle(SimpleWebServiceOutboundGateway.java:98)
..
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1964)
如何为https类型创建ws:outbound gateway工作?如果需要,我不知道如何指定证书