Hi friends,
I am handling a ws security, my webservices are in java and
client is in .NET, while connecting i am getting identifier as null, i.e.,
alias name null. Now i want to set the alias name if identifier, i handled
but it is not working.Kindly help me friends.
my code snippet is as below:
public class PasswordCallBackHandler implements CallbackHandler
{
private static Log LOG =
LogFactory.getLog(PasswordCallBackHandler.class);
public PasswordCallBackHandler ()
{
}
public void handle ( Callback[] callbackArray ) throws IOException,
UnsupportedCallbackException
{
LOG.info ( "PasswordCallback handle" ) ;
for ( int i = 0; i < callbackArray.length; i++ )
{
if ( callbackArray[i] instanceof WSPasswordCallback )
{
WSPasswordCallback callback =
(WSPasswordCallback)callbackArray[i] ;
int usage = callback.getUsage () ;
String identifier = callback.getIdentifer () ;
LOG.info("Identifier::"+identifier);
if ( (VPSUtils.getCredentials().
get(Constants.SERVICE_USERNAME)
).equals(identifier)) {
callback.setPassword ( VPSUtils.getCredentials().
get(Constants.SERVICE_PASSWORD) ) ;
return;
} else if ( (VPSUtils.getCredentials().
get(Constants.CLIENT_USERNAME)).equals(identifier)) {
callback.setPassword (VPSUtils.getCredentials().
get(Constants.CLIENT_PASSWORD)) ;
return;
} else if(identifier == null)
{
LOG.info("Identifier::"+identifier);
LOG.info("Identifier is null
now handling default
identifier");
callback.setIdentifier((VPSUtils.getCredentials().
get(Constants.SERVICE_USERNAME)));
callback.setPassword
(VPSUtils.getCredentials().
get(Constants.SERVICE_PASSWORD)) ;
return;
}
}
}
//throw new java.io.IOException ( "PasswordCallback: unrecognized
password callback " + "instance or callback usage" ) ;
}
}
Thanks in Advacne
--------------
Siva.
--
View this message in context:
http://old.nabble.com/how-set-alias-name-if-Rampart-alias-is-null-tp26826882p26826882.html
Sent from the Axis - Dev mailing list archive at Nabble.com.