Hi Dushantha, Thanks for the update. Is there any other mediators can we use instead of switch,
Regards *Senuwan Withana* Software Engineer - Support Team | WSO2 Email : [email protected] Mobile: 94773212853 Web: http://www.wso2.com On Tue, Nov 14, 2017 at 12:26 PM, Dushantha Batuwita <[email protected]> wrote: > Hi Senuwan > > According to my understanding, we can use the switch mediator if you have > to route against many options oppose to filter mediator which lets you > choose one of the two paths. > Within the inSequence of the proxy, we can perform a method based routing > with a switch mediator as demonstrated. > There we check the HTTP method at the source attribute of the Switch > mediator and match against the regular expression to trap whatever the HTTP > method that we are interested in and proceed with the logic that you need > to perform. > > > <?xml version="1.0" encoding="UTF-8"?> > <proxy name="PatientDataMangingProxy" startOnLoad="true" transports="https > http" xmlns="http://ws.apache.org/ns/synapse"> > <target> > <inSequence> > > <switch source="$axis2:HTTP_METHOD"> > <case regex="^(.*(GET)).*$"> > > <sequence key="sequnceToProcessGET"/> > </case> > <case regex="^(.*(POST)).*$"> > > <sequence key="sequenceToProcessPOST"/> > </case> > <case regex="^(.*(PUT)).*$"> > <sequence key="Sequence"/> > </case> > <case regex="^(.*(DELETE)).*$"> > <sequence key="SequenceToProcessDELETE"/> > </case> > <default/> > </switch> > </inSequence> > <outSequence> > <send/> > </outSequence> > <faultSequence/> > </target> > </proxy> > > > regards > > > On Tue, Nov 14, 2017 at 12:10 PM, Senuwan Withana <[email protected]> > wrote: > >> Hi Team, >> >> What is the best approach to mediate the logic based on the REST CRUD >> operations request within the ESB proxy ? >> >> Regards, >> >> *Senuwan Withana* >> Software Engineer - Support Team | WSO2 >> >> Email : [email protected] >> Mobile: 94773212853 >> Web: http://www.wso2.com >> >> >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > *Dushantha Nayanajith Chandima Batuwita* > Software Engineer Support | WSO2 > [email protected] > mobile : 0094777453010 >
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
