Hi, I also tried same scenario once and received the same error. This seems to be a known issue, It has been discussed in this mail thread. [Dev] getPayloadJSON returning an empty object
Regards Roshan On Tue, Mar 24, 2015 at 12:27 PM, Ishan Jayawardena <[email protected]> wrote: > What are the builder and formatter that you have registered? > > On Tue, Mar 24, 2015 at 12:17 PM, Vijayaratha Vijayasingam < > [email protected]> wrote: > >> Hi Ishan; >> I tried following json line[1] in APIM 1..80 >> But im getting following error; >> >> My request is a valid json as mentioned below; >> >> { >> "company_uui":"xxx", >> "name": "Y" >> } >> >> Why script mediator could not extract 'name' from the incoming json >> payload? >> >> [1]var name= *mc.getPayloadJSON().name.toString*; >> >> [2] >> >> 2015-03-24 11:58:40,804] ERROR - ScriptMessageContext JSON object is null. >> >> [2015-03-24 11:58:40,806] ERROR - ScriptMediator Error in execution : >> >> org.mozilla.javascript.EcmaError: TypeError: Cannot read property >> "toString" from undefined (eval#2) >> >> at >> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3687) >> >> at >> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3665) >> >> at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3693) >> >> at >> Thanks. >> -- >> -Ratha >> > > > > -- > Ishan Jayawardena > Senior Software Engineer > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Roshan Wijesena. Senior Software Engineer-WSO2 Inc. Mobile: *+94719154640* Email: [email protected] *WSO2, Inc. :** wso2.com <http://wso2.com/>* lean.enterprise.middleware.
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
