hello I have the following class mediator created through Carbon Studio:
package my.mediation;
import org.apache.synapse.MessageContext;
import org.apache.synapse.mediators.AbstractMediator;
public class Auth extends AbstractMediator {
public boolean mediate(MessageContext context) {
// TODO Implement your mediation logic here
context.setProperty("message","hello world!" );
return true;
}
}
And the sequence is like:
<inSequence xmlns="http://ws.apache.org/ns/synapse">
<property name="message" value="nothing" scope="default" />
<class name="my.mediation.Auth" />
<log>
<property name="Message******" expression="get-property('message')" />
</log>
</inSequence
>
The problem is that instead of printing Message: “HelloWorld” it always print the text “nothing”…Any suggestion?
Your scenario is perfectly valid one and your configuration also seems to be fine.
I have tied your scenario and it works fine for me.
Following are my configurations.
Class Mediator:
My proxy service:
When I invoke the proxy service without the class mediator, it prints
and when I invoke the proxy service with the class mediator it prints,
Hope this helps!
Harshana