Hi Sunil,

On Wed, Aug 19, 2009 at 12:24 PM, Sunil.2.Tiwari <[email protected]
> wrote:

>
> Hello All,
> Looking for Dynamic transformation using Synapse ESB.
> Requirement is to create a Proxy Service which will receive a request,
> based on input payload/header/namespaces;
> transform the requests in different format (using different xsl files).
> Hence route transformed request to desired endpoints.


I think this can be achieved by using the filter mediator or the switch
mediator. Have a look at sample 1 and 2 in the Synapse samples guide [1] to
get an idea about how to use these mediators. Sample 1 is a content based
routing scenario where the filter mediator is used to lookup a SOAP header
and route the message to the desired endpoint. Sample 2 shows how the
message payload is checked using XPath and based on the XPath evaluation a
property is set on the message. In your case you will have to use the XSLT
mediators within the <case> elements of the switch mediator configuration.
So ultimately you will have something like this.

    <switch source="XPath expression">
        <case regex="value1">
            <xslt key="key1"/>
        </case>
        <case regex="value2">
            <xslt key="key2"/>
        </case>
        <default>
            <xslt key="defaultKey"/>
        </default>
    </switch>


Hope this helps.

Thanks,
Hiranya


>
>
> Someone tried this? Hoe we may achieve this?
>
>
> Thanks & Regards
>
> Sunil Kumar Tiwari | Tech Mahindra Ltd.
>
> (Office: 009120 6641 7136  Mobile: 0091 9767644210)
>
> Email: [email protected]
>
>
>
>
> ============================================================================================================================
>
>
> Disclaimer:
>
> This message and the information contained herein is proprietary and
> confidential and subject to the Tech Mahindra policy statement, you may
> review the policy at <a href="http://www.techmahindra.com/Disclaimer.html
> ">http://www.techmahindra.com/Disclaimer.html</a> externally and <a href="
> http://tim.techmahindra.com/Disclaimer.html";>
> http://tim.techmahindra.com/Disclaimer.html</a> internally within Tech
> Mahindra.
>
>
> ============================================================================================================================




-- 
Hiranya Jayathilaka
Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: [email protected];  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

Reply via email to