Hi,

You also need add SAAJInInterceptor & WSS4JInInterceptor for cxf bc consumer endpoint inInterceptors, which extract and save necessary info to the vector
You may need take a look at xbean-jaas.xml[1], to learn how it could be

[1]https://svn.apache.org/repos/asf/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/test/resources/org/apache/servicemix/cxfbc/ws/security/xbean-jaas.xml

Freeman
On 2010-1-5, at 下午6:09, Philip wrote:

Hi,

thanks for your patient help. We integrated the interceptor as you explained
and tested it with the following soap-message:

   <soapenv:Header>
       <wsse:Security>
           <wsse:usernameToken     wsu:Id="UsernameToken"
                                           xmlns:wsu="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
">
               <wsse:username>Peter</wsse:username>
               <wsse:password>xyz</wsse:password>
           </wsse:usernameToken>
       </wsse:Security>
   </soapenv:Header>

We tried to read out the results vector but didn´t get an output.
Furthermore we added a logger to locate the error. In our opinion the vector
is null. Is our SOAP message correct? Any ideas?


On Mon, Jan 4, 2010 at 1:36 PM, Freeman Fang <[email protected]> wrote:


          List<Object> results =
(Vector<Object>)message.get(WSHandlerConstants.RECV_RESULTS);
          if (results == null) {


logger.info("vector null?");  // the console shows this message

              return;
          }


logger.info("not null"); // no message in cosole

          for (Iterator iter = results.iterator(); iter.hasNext();) {
              WSHandlerResult hr = (WSHandlerResult) iter.next();
              if (hr == null || hr.getResults() == null) {
                  return;
              }

              for (Iterator it = hr.getResults().iterator();
it.hasNext();) {
WSSecurityEngineResult er = (WSSecurityEngineResult)
it.next();

                  if (er != null && er.getPrincipal() instanceof
WSUsernameTokenPrincipal) {
                      WSUsernameTokenPrincipal p =
(WSUsernameTokenPrincipal)er.getPrincipal();
                      p.getName();//here you get the username
                      p.getPassword();//here you get the password
                  }
              }
          }


Thanks in advance
Nicolas and Philip


--
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com

Reply via email to