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