首页 > 解决方案 > WS-Trust 的命名空间问题

问题描述

当我向 WS-Trust 端点发送请求时,我的请求包括 WS-Trust namespace http://docs.oasis-open.org/ws-sx/ws-trust/200512,但 WS-Trust Endpoint 抛出错误

 <soap:Fault>
     <soap:Code>
        <soap:Value>soap:Sender</soap:Value>
     </soap:Code>
     <soap:Reason>
        <soap:Text xml:lang="en">Unexpected element {http://docs.oasis-open.org/ws-sx/ws-trust/200512}RequestSecurityToken found.   Expected {http://docs.oasis-open.org/ws-sx/ws-trust/200512/}RequestSecurityToken.</soap:Text>
     </soap:Reason>
  </soap:Fault>

如果我使用 namespace ,它工作得很好http://docs.oasis-open.org/ws-sx/ws-trust/200512/,但是我如何在我的 WS-Trust 端点上进行更改,以便它接受带有http://docs.oasis-open.org/ws-sx/ws-trust/200512. 我检查了我的wsdl,它的命名空间为http://docs.oasis-open.org/ws-sx/ws-trust/200512.

标签: javaweb-servicessoapws-trust

解决方案


我通过更改targetNamespace从 WSDL 生成的 java 资源来解决此问题。


推荐阅读