Dear
John,
This
is reallly simple.
The
only think you have to do is to "throw" a AxisFault wihtin the invoke method as
shown in the code below:
public
class MyHandler extends BasicHandler {
//member variables
public void invoke(MessageContext msgContext) throws AxisFault
{
// Log an access each time we get invoked.
try {
Handler serviceHandler = msgContext.getService();
String sUser = msgContext.getUsername();
String sPassword = msgContext.getPassword();
//....
//member variables
public void invoke(MessageContext msgContext) throws AxisFault
{
// Log an access each time we get invoked.
try {
Handler serviceHandler = msgContext.getService();
String sUser = msgContext.getUsername();
String sPassword = msgContext.getPassword();
//....
if (sUser.equals("") ||
sPassword.equals("")){
throw new AxisFault("Blank Passsword and user!", "Invalide values!", null, null);
}
} catch (Exception e) {
e.printStackTrace();
throw AxisFault.makeFault(e);
}
}
}
throw new AxisFault("Blank Passsword and user!", "Invalide values!", null, null);
}
} catch (Exception e) {
e.printStackTrace();
throw AxisFault.makeFault(e);
}
}
}
I hope
this helps.
Regards,
FL�VIO DE OLIVEIRA SILVA
UNIMINAS
Uberl�ndia, MG Brazil
-----Mensagem original-----
De: John McCosker [mailto:[EMAIL PROTECTED]
Enviada em: quinta-feira, 24 de mar�o de 2005 05:52
Para: '[email protected]'
Assunto: Handlers and authenticationHi, I have a simple question.
If a handler authenticates a request and the username and password is not set or invalid,
how do I stop the request getting through to the actual service and send a response back?Thanks for all advice.
--
Esta mensagem foi verificada pelo sistema de antiv�rus e
acredita-se estar livre de perigo.
