Remsy
I'm afraid your solution is not the proper solution. You should just
throw a SynapseException and optionally set an error code and other
details. You can look at the current code for all our mediators in the
Apache Synapse project source at synapse.apache.org
asankha
Schmilinsky, Remsy wrote:
> Hi, I found the solution. You must set the message body and pass it to the
> fault sequence mediator. Example:
>
> public boolean mediate(MessageContext mc) {
> if (error) {
> mc.getEnvelope().getBody().getFirstElement().setText("I FAILED....");
> mc.getFaultSequence().mediate(mc);
> return false;
> }
> else {
> mc.getEnvelope().getBody().getFirstElement().setText("I PASSED....");
> return true;
> }
> }
>
> Remsy
>
> -----Original Message-----
> From: Schmilinsky, Remsy
> Sent: September 23, 2008 7:38 AM
> To: '[email protected]'
> Subject: fault messages
>
>
> Hi. How can I generate fault messages from a mediator ? Whenever the mediator
> returns false, I want to propagate the reasons to the default fault sequence,
> is it possible ?
>
> The response I get when the mediator returns false is s soap message with a
> empty body.
>
> thanks
>
> Remsy
>
> _______________________________________________
> Esb-java-user mailing list
> [email protected]
> http://mailman.wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>
>
_______________________________________________
Esb-java-user mailing list
[email protected]
http://mailman.wso2.org/cgi-bin/mailman/listinfo/esb-java-user