Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8564143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:07:44+00:00 2026-06-11T17:07:44+00:00

hello I have the following class mediator created through Carbon Studio: package my.mediation; import

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:07:45+00:00Added an answer on June 11, 2026 at 5:07 pm

    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:

    package org.wso2.mediator;
    
    import org.apache.synapse.MessageContext; 
    import org.apache.synapse.mediators.AbstractMediator;
    
    public class SampleMediator extends AbstractMediator { 
    
        public boolean mediate(MessageContext context) { 
            context.setProperty("Message", "HelloWorld!");
            return true;
        }
    }
    

    My proxy service:

    <proxy xmlns="http://ws.apache.org/ns/synapse" name="SimpleProxy"
        statistics="disable" trace="disable" transports="http,https">
        <target>
            <inSequence>
                <log category="INFO" level="simple" separator=","/>
                <property action="set" name="Message" scope="default"
                    type="STRING" value="DefaultMessage"/>
                <class name="org.wso2.mediator.SampleMediator"/>
                <log category="INFO" level="simple" separator=",">
                    <property expression="get-property('Message')" name="===========Message Value=========="/>
                </log>
                <drop/>
            </inSequence>
        </target>
    </proxy>
    

    When I invoke the proxy service without the class mediator, it prints

    INFO - LogMediator To: /services/SimpleProxy.SimpleProxyHttpSoap12Endpoint,WSAction: urn:mediate,SOAPAction: urn:mediate,MessageID: urn:uuid:81150094-cbc4-44f7-83eb-251e28149564,Direction: request,===========Message Value========== = DefaultMessage
    

    and when I invoke the proxy service with the class mediator it prints,

    INFO - LogMediator To: /services/SimpleProxy.SimpleProxyHttpSoap12Endpoint,WSAction: urn:mediate,SOAPAction: urn:mediate,MessageID: urn:uuid:e3a04341-907c-40fe-9f58-5a10d2ce346a,Direction: request,===========Message Value========== = HelloWorld!
    

    Hope this helps!

    Harshana

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following classses Hello.java package speak.hello; import java.util.Map; import speak.hi.CustomMap; import speak.hi.Hi; public
Hello I have the following code namespace ConsoleApplication2 { class Program { static void
I have following code snippet: class ABC{ public: int a; void print(){cout<<hello<<endl;} }; int
I have the following form code: # forms.py class SomeForm(forms.Form): hello = forms.CharField(max_length=40) world
I have following simple program: import std.stdio; int main(string[] argv) { writeln(Hello, world!); return
I have the following class in Java which prints Hello World in portuguese: public
Hi I have the following code: Controller: @Controller public class HelloWorldController { @RequestMapping(/hello) public
I have the following code: class Hello { class Thing { public int size;
Let us say I have the following class.. Class Boy { public void hello()
I have the following construct: class Bla { public string Hello() { return Hello

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.