Hi Dushan,

Thanks. It seems that the functions available via the Rhino JAR are
available within the Script mediator as well.

However, when sending a payload with integer values, the integers seem to be
rewritten in to the payload as float values. 

In the following instance;

if (paymentMethodRef != null && paymentMethodRef != "" && paymentMethodRef
!= "null") {                                        payload.PaymentMethodRef
= eval("("+ paymentMethodRef +")");                                        
var numString = "5.0";                                        
var parsedInt = parseInt(numString,10);                                        
print(parsedInt);                                               
payload.PaymentMethodRef.value = parsedInt;                                 
}

The print function prints 5 but the payload sent is
PaymentMethodRef":{"value":5.0} and the endpoint rejects it.

Is there some other functionality that is causing this? 

Thanks. 



--
View this message in context: 
http://wso2-oxygen-tank.10903.n7.nabble.com/ESB-JavaScript-API-for-Script-mediator-tp97411p97611.html
Sent from the WSO2 Development mailing list archive at Nabble.com.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to