Hi Nick,
This behavior is exactly what is expected. If you want to mediate the newly
forked message using another sequence you need to call the following, rather
than injectMessage.
newCtx.getConfiguration.getSequence($DEFINED_SEQUENCE_NAME).mediate(newCtx);
Expected behavior of the injectMessage is just to mediate using the main
sequence if the message is not a response to a proxy service. In your case
it is not a response and also by setting the EPR to the proxy EPR, synapse
wont detect it as a proxy service message what you have to do is set the
property
newCtx.setProperty(org.apache.synapse.Constants.PROXY_SERVICE,
$NAME_OF_THE_PROXY);
newCtx.setResponse(true);
Or else you can do the following to get it dispatched to the proxy, rather
than injecting the message:
(new SendMediator()).mediate(newCtx);
BTW: I have almost finished the Splitter and will commit it soon.
PS: But, because of this mail of yours, I feel like it is good to add some
logic to handle your case in the injectMessage method. I will add this soon
at let you know. Thanks for the information and hope you will provide us
some more ideas.
Thanks,
Ruwan.
On 8/16/07, Nick Cook <[EMAIL PROTECTED]> wrote:
>
>
> On 7 Aug 2007, at 14:24, Ruwan Linton wrote:
>
> > Hi Nick,
> >
> > First of all sorry for the delay.
> >
> > I have done a fix to the SynapseEnviorenment.createMessageContext()
> > and
> > tested the code that you have provided in this thread, it should
> > work now,
> > but I had to change the EPR since it again points to localhost:8080
> > which is
> > again synapse (may be you could create a proxy inside synapse and
> > put that
> > EPR to test, that is what I have done)
>
> - I have tried, but I am not sure if I understand.
>
> I have a defined main sequence for synapse and a proxy (named
> "injectProxy").
>
> creating the new message context works and then I do the following:
>
> newCtx.setTo(new EndpointReference("http://localhost:8080/soap/
> injectProxy"));
> newCtx.setWSAAction("urn:inject:test");
> synEnv.injectMessage(newCtx);
>
> but whatever I use for the EPR the main sequence of synapse is used
> for the new message context.
>
> I get the following output in the log:
>
> [HttpServerWorker-1] DEBUG Axis2SynapseEnvironment - Creating Message
> Context
> [HttpServerWorker-1] DEBUG Axis2SynapseEnvironment - Injecting
> MessageContext
> [HttpServerWorker-1] DEBUG Axis2SynapseEnvironment - Using Main
> Sequence for injected message
> ...
> ...
> [HttpServerWorker-1] DEBUG LogMediator - Log mediator :: mediate()
> [HttpServerWorker-1] INFO LogMediator - To: http://localhost:8080/
> soap/injectProxy, WSAction: urn:inject:test
> ...
>
> 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"