synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruwan Linton" <ruwan.lin...@gmail.com>
Subject Re: soap fault through class mediators
Date Sat, 29 Mar 2008 23:01:40 GMT
Hi Venkatesan,

There are two possible answers, first in which is to construct a SOAPFault
and set it to the message context envelope, but I think the more appropriate
way of doing this is through throwing an exception with the required
message.

throw new SynapseException("This is the error");

Thanks,
Ruwan

On Sat, Mar 29, 2008 at 11:24 PM, Venkatesan, Kumaran <
Kumaran.Venkatesan@in.standardchartered.com> wrote:

>  Hi,
>
>
>
> How to throw custom soap fault messages from the class mediators.
>
>
>
> I have the code like below.
>
>
>
> *if* (ome.getLocalName().equalsIgnoreCase("groupid")){
>
> *   if* (ome.getText() != *null*){
>
>       String soapUserid = ome.getText();
>
>       *if* (!soapUserid.equalsIgnoreCase(groupId)){
>
>       *logger*.debug("Groupid from Session object and SOAPXML not valid");
>
>       // *TODO*: soap fault  //here I need to throw soap fault and it will
> be captured at the client side.
>
>       //return false; <this will stop the message mediation alone>
>
> }
>
>    }
>
>
>
> This email is confidential. If you are not the addressee tell the sender immediately
and destroy this email
> without using, sending or storing it. Emails are not secure and may suffer errors, viruses,
delay,
> interception and amendment. Standard Chartered PLC and subsidiaries ("SCGroup") do not
accept liability for
> damage caused by this email and may monitor email traffic.
>
>


-- 
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"

Mime
View raw message