On Thu, Dec 30, 2010 at 7:02 PM, Supun Kamburugamuva <[email protected]> wrote:
> You can use a XSLT as well. > +1 Given the format of the input and output messages, I feel using some XSLT would be much easier. Thanks, Hiranya > > Thanks, > Supun.. > > On Thu, Dec 30, 2010 at 6:29 PM, Paul Fremantle <[email protected]> wrote: > > Do you need performance? > > I love using E4X/JS mediator for this sort of thing! > > > > Paul > > > > On 30 December 2010 11:40, Amila Suriarachchi <[email protected]> wrote: > >> > >> hi, > >> > >> I try to write a sample which uses rules and ESB to process a customer > >> order. > >> > >> For that I have this requirement. > >> > >> The esb proxy service receives a message like this, > >> > >> <ns2:CustomerOrderProcessRequest xmlns:ns2="http://brs.carbon.wso2.org > "> > >> <ns2:Customer> > >> <ns2:name>Amila</ns2:name> > >> <ns2:rating>0.5</ns2:rating> > >> <ns2:maxAmount>50</ns2:maxAmount> > >> <ns2:Order> > >> <items xmlns="http://pojo.sample.brs/xsd"> > >> <price>50.0</price> > >> <type>TypeA</type> > >> </items> > >> <items xmlns="http://pojo.sample.brs/xsd"> > >> <price>60.0</price> > >> <type>TypeB</type> > >> </items> > >> <ns1:orderID > >> xmlns:ns1="http://pojo.sample.brs/xsd">Order1</ns1:orderID> > >> </ns2:Order> > >> <ns2:Order> > >> <items xmlns="http://pojo.sample.brs/xsd"> > >> <price>50.0</price> > >> <type>TypeA</type> > >> </items> > >> <items xmlns="http://pojo.sample.brs/xsd"> > >> <price>60.0</price> > >> <type>TypeA</type> > >> </items> > >> <ns1:orderID > >> xmlns:ns1="http://pojo.sample.brs/xsd">Order2</ns1:orderID> > >> </ns2:Order> > >> </ns2:Customer> > >> </ns2:CustomerOrderProcessRequest> > >> > >> Then ESB has to send the following message to rule service. > >> > >> <ns2:CalculatePriceRequest xmlns:ns2="http://brs.carbon.wso2.org"> > >> <ns2:Order> > >> <items xmlns="http://pojo.sample.brs/xsd"> > >> <price>50.0</price> > >> <type>TypeA</type> > >> </items> > >> <items xmlns="http://pojo.sample.brs/xsd"> > >> <price>60.0</price> > >> <type>TypeB</type> > >> </items> > >> <ns1:orderID > >> xmlns:ns1="http://pojo.sample.brs/xsd">Order1</ns1:orderID> > >> </ns2:Order> > >> <ns2:Order> > >> <items xmlns="http://pojo.sample.brs/xsd"> > >> <price>50.0</price> > >> <type>TypeA</type> > >> </items> > >> <items xmlns="http://pojo.sample.brs/xsd"> > >> <price>60.0</price> > >> <type>TypeA</type> > >> </items> > >> <ns1:orderID > >> xmlns:ns1="http://pojo.sample.brs/xsd">Order2</ns1:orderID> > >> </ns2:Order> > >> </ns2:CalculatePriceRequest> > >> > >> Currently I have the following ESB configuration which passes the > received > >> message as it is. > >> > >> <proxy name="CustomerOrderService" transports="https http" > >> startOnLoad="true" trace="disable"> > >> <target inSequence="CustomerOrderInSequence" > >> outSequence="CustomerOrderOutSequence"/> > >> </proxy> > >> <sequence name="CustomerOrderInSequence"> > >> <send> > >> <endpoint > >> name="endpoint_urn_uuid_EA2F12A5E60B83D785297590854239961202342050"> > >> <address > >> uri="http://111.223.141.139:9762/services/PriceCalculatorService"/> > >> </endpoint> > >> </send> > >> </sequence> > >> <sequence name="CustomerOrderOutSequence"> > >> <send/> > >> </sequence> > >> > >> I need to get the orders from the received request and create the out > put > >> message. > >> One options is to use the XSLT transformations instead of can I use the > >> enrich mediator? > >> > >> If I use enrich mediator what are the steps? > >> > >> I tried to do following steps. But seems to be not working. > >> > >> 1. create a property with empty > >> <ns2:CalculatePriceRequest xmlns:ns2="http://brs.carbon.wso2.org"> > >> > >> 2. Then copy the orders from the soap body to the element property. > >> 3. Replace this property om element with the soap body. > >> > >> thanks, > >> Amila. > >> > >> _______________________________________________ > >> Carbon-dev mailing list > >> [email protected] > >> https://wso2.org/cgi-bin/mailman/listinfo/carbon-dev > >> > > > > > > > > -- > > Paul Fremantle > > CTO and Co-Founder, WSO2 > > OASIS WS-RX TC Co-chair, VP, Apache Synapse > > > > Office: +44 844 484 8143 > > Cell: +44 798 447 4618 > > > > blog: http://pzf.fremantle.org > > twitter.com/pzfreo > > [email protected] > > > > wso2.com Lean Enterprise Middleware > > > > Disclaimer: This communication may contain privileged or other > confidential > > information and is intended exclusively for the addressee/s. If you are > not > > the intended recipient/s, or believe that you may have received this > > communication in error, please reply to the sender indicating that fact > and > > delete the copy you received and in addition, you should not print, copy, > > retransmit, disseminate, or otherwise use the information contained in > this > > communication. Internet communications cannot be guaranteed to be timely, > > secure, error or virus-free. The sender does not accept liability for any > > errors or omissions. > > > > _______________________________________________ > > Carbon-dev mailing list > > [email protected] > > https://wso2.org/cgi-bin/mailman/listinfo/carbon-dev > > > > > > > > -- > Supun Kamburugamuva > Technical Lead > WSO2 Inc.; http://wso2.org > E-mail: [email protected]; Mobile: +94 77 431 3585 > Blog: http://supunk.blogspot.com > _______________________________________________ > Carbon-dev mailing list > [email protected] > https://wso2.org/cgi-bin/mailman/listinfo/carbon-dev > -- Hiranya Jayathilaka Senior Software Engineer; WSO2 Inc.; http://wso2.org E-mail: [email protected]; Mobile: +94 77 633 3491 Blog: http://techfeast-hiranya.blogspot.com
_______________________________________________ Carbon-dev mailing list [email protected] https://wso2.org/cgi-bin/mailman/listinfo/carbon-dev
