Fulya,

are you using Axis2?If so, the invoke() method returns a
InvocationResponse, it's not void. Only if InvocationResponse.CONTINUE
is returned the AxisEngine will invoke the next handler in the chain.

Hope this helps,
Michele

On Wed, 2007-02-07 at 18:00 +0200, Fulya Tuncer wrote:
> Hi all,
> We try to implement access control for web services.Therefore before 
> methods of web services run, a request handler is started to permit or 
> deny access to the web service.The handler makes the decision and at 
> this point, if the decision is deny, then it should stop the method 
> invocation and abort. After a google-search we found that AxisFault 
> could be thrown in invoke method of the handler.Therefore we added 
> "throw new AxisFault()" to the handler,after that we catch the exception 
> in run time but invocation still proceeds.
> Any ideas how to stop execution of web services via handlers?
> 
> 
> Thanks in advance,
> Best regards
> 
> 
> And here is our handler code which is a bit shortened.
> 
> In switch code fragment of invoke method, we try to stop execution by 
> throwing AxisFault according value of pdpDecision.
> 
> public class DecisionHandler extends BasicHandler{
> 
>    public void invoke(MessageContext msgContext) throws AxisFault {
>           try{
>            Message msg = msgContext.getResponseMessage();
>            SOAPHeader soapHeader =  msg.getSOAPHeader();
>            NodeList responseElements = 
> soapHeader.getElementsByTagName(".....");
> 
>             ......
>             int pdpDecision = xacmlResult.getDecision();
> 
>            switch(pdpDecision){
>                    case Result.DECISION_DENY:
>                        System.out.println("DECISION_DENY");
>                        throw new AxisFault();
>                    case 
> Result.DECISION_INDETERMINATE:                                            
>                         System.out.println("DECISION_INDETERMINATE");
>                        throw new AxisFault();
>                    case Result.DECISION_NOT_APPLICABLE:
>                        System.out.println("DECISION_NOT_APPLICABLE");
>                        throw new AxisFault();
>                    case Result.DECISION_PERMIT:
>                        System.out.println("DECISION_PERMIT");
>                        break;
>                    }
>            }
>        }
>        catch (SOAPException e) {
>            e.printStackTrace();
>        } catch (ParsingException e) {
>            e.printStackTrace();
>        }
> }
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to