|
Hi Asankha, I didn’t get your email, looks like
it got lost. I was expecting some reply from you and waited for whole day
yesterday. This morning I thought I would look into the source to see what’s
going on and luckily come across this. Thank you for all your effort. Sanjesh From: Asankha C. Perera [mailto:[EMAIL PROTECTED] Sanjesh I found the answer to my question. After looking at
the source code I found out that properties are only copied from request
message context to response message context if the property name starts with
org.apache.synapse.Constants.CORRELATE (i.e. “correlate/") string. Sanjesh From: Sanjesh
Pathak [mailto:[EMAIL PROTECTED]] Hi Hadrian, Thanks for your offer of help. I have
followed the builtin log mediator and developed a mediator. In mediate method I
am doing this: public
boolean mediate(MessageContext synCtx) {
// check if it is in request phase
if(!synCtx.isResponse()) {
// if request, set property value
synCtx.setProperty("Id", new Long(1));
} else {
// response phase, retrieve value
Long i = (Long) synCtx.getProperty("Id");
// I am getting i as null here
if(i != null) {
log.info("Id:
" + i.longValue());
} else {
log.info("i is
null");
}
}
return true; } The value of i is null in
response phase. I have gone through the debugger as well and I see i as null
during response. I am attaching synapse.xml
file with this mail. The mediator tag is <myMediator/> which is below
<log../> tag. Sanjesh From: Hadrian
Zbarcea [mailto:[EMAIL PROTECTED]] Hi Sanjesh, On 8/15/06, Sanjesh Pathak <[EMAIL PROTECTED]> wrote: Hi, I have created a new mediator and it is working fine. Now I
want to set a property value in the request phase of the mediate method and
retrieve it in response phase. What is the right approach? I tried using msgContext:setProperty() in request phase and
when I retrieve it using msgContext :getPorperty() I am getting a null value. Sanjesh |
- getting property value Sanjesh Pathak
- Re: getting property value Hadrian Zbarcea
- RE: getting property value Sanjesh Pathak
- Re: getting property value Asankha C. Perera
- RE: getting property value Sanjesh Pathak
- RE: getting property value Sanjesh Pathak
- Re: getting property value Asankha C. Perera
- RE: getting property value Sanjesh Pathak
- Re: getting property value Asankha C. Perera
