Json Service Call in Dynamics Ax 2012.

Recently I got chance to call restful Json based service in Dynamics Ax 2012.

I used a C# class library and then add to AOT.  AX 2012

Json based service successfully called both client side and server side. Only tricky part was to make Json string or payload.

I used to make Json string something similar. Both works in C# as well as X++

 

 

payload += “{\”ApproversEmpCode\”:\””+ employeeCode +”\”,”;

payload += “\”message\”:\””+table.Message +” “+ strReplace(Message,”\'”,”`”)+”\”,”;

payload +=  “\”requestType\”:\”” +tableId2Name(TableId) +”\”,”;

payload += “\”transactionId\”:\””+int642str(RecId)+”\”}”;

 

 

Happy Daxing.

alirazazaidi

Advisory software engineer, Software engineer, Last 4 years focus on Dynamics Ax 2012. MVP and Microsoft Certified trainer for Dynamics AX.