Ruwan,


Thanks a lot for your prompt response on this.



The issue was resolved and the client application has received the soap
fault message.  Initially have tried the same logic and the soap fault
was created at the synapse server but not sent to the client even with
"<send/>" mediator in the myFaultHander sequence.



Then have added the "<property name="RESPONSE" value="true" />" in
synapse.xml to send message out.



<?xml version="1.0" encoding="UTF-8"?>

<definitions xmlns="http://ws.apache.org/ns/synapse";>

<sequence name="myFaultHandler">

<makefault>

                                 <code value="tns:Receiver"
xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>

                                 <reason
expression="get-property('ERROR_MESSAGE')"/>

                                <detail>This is the detail section of
the makefault mediator</detail>

        </makefault>

        <property name="RESPONSE" value="true" />

          <send/>

</sequence>



Now, the challenge is to dynamically change the value of <detail> tag of
soap fault, so that it could be extracted in the client application.



Any idea, how to dynamically change the value of <detail> tag, mostly it
could be the value of synapseException  like below "This is the error".



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





________________________________

From: Ruwan Linton [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 30, 2008 7:02 AM
To: [email protected]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: soap fault through class mediators



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
<[EMAIL PROTECTED]> 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"

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.

Reply via email to