Hi Maz, There is a known issue in script mediator while you use the JSON functionalists such like "JSON.stringify()" due to the issue mentioned in [1] However, it is under our radar and we will fix it in near future.
Having said that, as malaka and Sajith told; you can make use of in-build methods given by script mediator such as getPayloadJSON() and setPayloadJSON().[2] [1] https://wso2.org/jira/browse/ESBJAVA-3019 [2] https://docs.wso2.com/display/ESB481/JSON+Support#JSONSupport-ConstructingandtransformingJSONpayloads On Tue, Dec 23, 2014 at 6:58 AM, Malaka Silva <[email protected]> wrote: > Further to the above [1] will provide more details on this. > > [1] https://docs.wso2.com/display/ESB481/JSON+Support > > On Tue, Dec 23, 2014 at 2:32 AM, Sajith Ravindra <[email protected]> wrote: > >> Hi Maz, >> >> There is a equivalent for JSON in script mediator, it's getPayloadJSON(). >> You can refer [1] for an example on converting JSON to XML. >> >> [1] - >> https://docs.wso2.com/display/ESB481/Sample+440%3A+Converting+JSON+to+XML+Using+XSLT >> >> Thanks >> *,Sajith Ravindra* >> Senior Software Engineer >> WSO2 Inc.; http://wso2.com >> lean.enterprise.middleware >> >> mobile: +94 77 2273550 >> blog: http://sajithr.blogspot.com/ >> <http://lk.linkedin.com/pub/shani-ranasinghe/34/111/ab> >> >> On Mon, Dec 22, 2014 at 3:51 PM, Maz Lakadia <[email protected]> >> wrote: >> >>> I am trying to use Script Mediator to convert a message Payload. >>> However, Samples are all using a method called getPayloadXML. My Payload >>> will be in JSON form; is there a JSON equivalent of this? I could transform >>> the Payload to XML for my mediations, but that's a last resort. >>> >>> Thank you, >>> >>> Maz >>> >>> _______________________________________________ >>> Dev mailing list >>> [email protected] >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > > Best Regards, > > Malaka Silva > Senior Tech Lead > M: +94 777 219 791 > Tel : 94 11 214 5345 > Fax :94 11 2145300 > Skype : malaka.sampath.silva > LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77 > Blog : http://mrmalakasilva.blogspot.com/ > > WSO2, Inc. > lean . enterprise . middleware > http://www.wso2.com/ > http://www.wso2.com/about/team/malaka-silva/ > <http://wso2.com/about/team/malaka-silva/> > > Save a tree -Conserve nature & Save the world for your future. Print this > email only if it is absolutely necessary. > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Sivajothy Vanjikumaran *Senior Software Engineer* *Integration Technologies Team* *WSO2 Inc. http://wso2.com <http://wso2.com/>* *Mobile:(+94)777219209* [image: Facebook] <https://www.facebook.com/vanjikumaran> [image: Twitter] <https://twitter.com/vanjikumaran> [image: LinkedIn] <http://www.linkedin.com/pub/vanjikumaran-sivajothy/25/b31/293> [image: Blogger] <http://vanjikumaran.blogspot.com/> [image: SlideShare] <http://www.slideshare.net/vanjikumaran> 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, re-transmit, 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
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
