org.springframework.ws.client.WebServiceTransportException:代理错误 [502]
当我尝试通过客户端调用网络服务时,出现以下错误: 我正在使用 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)
I am getting below error when I am trying to call the webservice through my client :
I am using Spring WS -> Wss4jSecurityInterceptor. and Using Private and public key for encryption and decryption.
Config :
<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>
Error Dumstack is :
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果客户端接受响应但不返回回复,并且在代理服务器后面运行,则可能会出现 502 代理错误。
If client accepts the response but does not return a reply, it may give you a 502 proxy error if it's operating behind a proxy server.