Hi Chinthaka,

sorry if i'm not describing my problem clearly enough. The point is
that, instead of going through the fault flow, the message is further
processed by the in flow, i.e. the invalid message reaches my service
implementation. 

An excerpt of my handler implementation looks as follows:

public class MessageValidatorInHandler 
    extends AbstractHandler implements Handler {

    public void invoke(MessageContext msgContext) throws AxisFault {
        // Here the message body is validated against a schema
        // and then:
        if(validationError) {
            throw new AxisFault("Message is invalid!"); 
        }       
    }
}

This handler processes incoming messages. I would like to send back a 
SOAPFault, 
if an error occured, but thats not happening.

I'm sorry if i made an obvious mistake. This is just for a sample Web 
service to get to know the engine better. And sadly i'm no java expert.
Andreas



-----Ursprüngliche Nachricht-----
Von: Eran Chinthaka [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 23. März 2006 12:51
An: axis-user@ws.apache.org
Betreff: Re: AW: [Axis2] schema validation


Hi Andreas,

What do you mean by "But instead of sending a SOAPFault to the 
sender the message is further processed by the engine." ?

Do you want engine not to invoke fault flow and send the message ? I 
don't think its a good idea. There can be some processing that has to be 
done by the handlers in the fault out flow. For example, the admin might 
decide to log every fault message. And addressing out handler again 
helps you to put the stuff in the msgCtxt to the SOAP message. So due to that, 
its not good only to invoke TransportSender, once a 
fault is thrown.

-- Chinthaka

Sensen, Andreas (external) wrote:
> Hi Ali,
>  
> thanks for the quick and detailed response, it helped me a lot! I have 
> just one followup question which you might have an answer to: I'd 
> really like to keep the validation in a module. It throws an AxisFault 
> if an incoming message is invalid. But instead of sending a SOAPFault 
> to the sender the message is further processed by the engine.
> Do you have any idea why?
>  
> Andreas
>  
>  
>
>     -----Ursprüngliche Nachricht-----
>     *Von:* Ali Sadik Kumlali [mailto:[EMAIL PROTECTED]
>     *Gesendet:* Donnerstag, 23. März 2006 10:54
>     *An:* axis-user@ws.apache.org
>     *Betreff:* Re: [Axis2] schema validation
>
>     Forgot to add sample for 3th item:
>
>     public
>     com.mycompany.service.test.schemas.account.OpenAccountResultDocument
>     OpenAccount(
>            
>     com.mycompany.service.test.schemas.account.OpenAccountDocument
>     param0) throws AxisFault {
>
>             validate (param0);
>     ...
>
>     }
>

Reply via email to