当我尝试通过我的客户端调用webservice时,我收到以下错误: 我正在使用Spring WS - > Wss4jSecurityInterceptor。并使用私钥和公钥进行加密和解密。
配置:
<bean id="wsClientSecurityInterceptor"
class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
<property name="validationActions" value="Encrypt Signature" />
<property name="securementActions" value="Signature Encrypt" />
<property name="securementSignatureKeyIdentifier" value="DirectReference" />
<property name="securementUsername" value="${ks-hps-hcentive_private.alias}" />
<property name="securementPassword" value="${ks-hps-hcentive-private-password}" />
<property name="securementSignatureCrypto" ref="ks-hps-hcentive-private" />
<property name="securementSignatureParts" value="{Element}{}Body" />
<property name="securementEncryptionCrypto" ref="ks-hps-public" />
<property name="securementEncryptionUser" value="${ws.keys.hps_public.alias}" />
<!-- <property name="securementEncryptionKeyIdentifier" value="Thumbprint" /> -->
<property name="securementEncryptionKeyIdentifier" value="SKIKeyIdentifier" />
<property name="securementEncryptionSymAlgorithm" value="http://www.w3.org/2001/04/xmlenc#aes256-cbc" />
<property name="securementEncryptionParts" value="{Element}{http://www.w3.org/2000/09/xmldsig#}Signature;{Content}{}Body" />
<property name="validationSignatureCrypto" ref="ks-hps-public" />
<property name="validationDecryptionCrypto" ref="ks-hps-hcentive-private" />
</bean>
错误Dumstack是:
DEBUG [client.core.WebServiceTemplate] Received error for request [SaajSoapMessage {http://www.w3.org/2001/04/xmlenc#}EncryptedData]
org.springframework.ws.client.WebServiceTransportException: Proxy Error [502]
at org.springframework.ws.client.core.WebServiceTemplate.handleError(WebServiceTemplate.java:627)
at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:551)
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:351)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:345)
答案 0 :(得分:1)
如果客户端接受响应但未返回回复,则如果它在代理服务器后面运行,则可能会给出502代理错误。