cxfc采用UsernameToken时的PasswordDigest问题

服务端设置为PasswordDigest时pc.getPassword()总是为空

查看soap报文,有password

<wsse:Password xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">H2PFzDbU+7VDftl2pGbOPmoHTV4=</wsse:Password>
    <wsse:Nonce xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd%22%3EaOwj2aGB55rMcRye//dvAw==%3C/wsse:Nonce>
    <wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd%22%3E2008-08-03T15:37:31.015Z%3C/wsu:Created>
   </wsse:UsernameToken>

 

后来发现文档上有这么一句话

if (pc.getIdentifer().equals("ws-client")) {
      // set the password on the callback. This will later be compared to the
      // password which was sent from the client.
      pc.setPassword("password");

原来只要set进去就会自动比较了,呵呵,搞了老半天

posted @ 2008-08-04 09:50  xwy.net  阅读(717)  评论(0编辑  收藏  举报