org.springframework.ws.client.WebServiceTransportException:代理错误 [502]

发布于 2024-12-09 16:25:56 字数 2498 浏览 0 评论 0原文

当我尝试通过客户端调用网络服务时,出现以下错误: 我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏末 2024-12-16 16:25:56

如果客户端接受响应但不返回回复,并且在代理服务器后面运行,则可能会出现 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文