Hi Nick,

On 7/11/07, Nick Cook <[EMAIL PROTECTED]> wrote:


On 11 Jul 2007, at 11:14, Ruwan Linton wrote:

> Hi Nick,
>
> Please see the comments in line in the mediator code;
>
>
>> ---
>>
>> Code Using injectMessage
>> ------------------------
>>
>> public boolean mediate(MessageContext ctx) {
>>          final SynapseEnvironment env = ctx.getEnvironment();
>>
>>          final MessageContext newCtx = env.createMessageContext();
>
>
>
> I think the above line is where you are doing something wrong,
> because it
> seems that your newCtx does not have a Axis2 ConfigurationContext
> associated
> with it.
>
> Use the following method to get the newCtx instead and try,
>
> final MessageContext newCtx = new Axis2MessageContext
> (((Axis2MessageContext)
> ctx).getAxis2MessageContext(), ctx.getConfiguration(), env);
>
> Just give it a try and let me know if there are any issues.
>
>
>

- actually it doesn't work. It seems I need to create a completely
new Axis2MessageContext because the above shares the same underlying
context between the message I am trying to inject and the original
message associated with "ctx". Hope this makes sense.



This might need a little bit more work, we need to build the whole context
hierarchy and associate them with each other. I will try to provide a method
for this ASAP (actually correcting the implementation of the
env.createMessageContext() would be the solution)


Thanks,
Ruwan


Nick


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"

Reply via email to