Alletec Blogs

20
Mar
18
Dynamics AX integration with a PHP application using JSON
Alletec Blogger 10comments Blogs Read 5813 times

Dynamics AX integration with a PHP application using JSON

Rate this item
(3 votes)

At this time, the majority of developers and solution architects are very well aware of the MS Dynamics AX capabilities to support different integration paths with third-party applications. Based upon different requirements one can choose integration paths like file-based, http based, etc. However, sometimes there are peculiar requirements from customers where none of the standard integration paths can be used and at such times, we have to think ‘outside the usual’ and come out with a workable solution for the same. There can be various reasons for this - like customer already has an established php front end for its customers/vendors/employees and wants to use & integrate it with AX with minimal changes to the existing system. One such option is to integrate (http adapter) with php application using JSON.

Solution approach:

JSON integration is not supported in AX, so we have to do customizations for the same. Again, we have many options like either we write a code to accept JSON based values and serialize it to xml or dataset and use the records OR develop a utility bundled in dll, which will do the transformation for you. In this blog, we will discuss the later approach.

Method:

We will create an integration port in AX to accept the data and store it in the staging tables. Secondly, we will create mid-tier .net utility as a web service, which will accept JSON values from the third party, serialize it and send that converted data to AX by calling AX web service.

  1. Creating integration port in AX: One can either use document-based integration using a wizard or write custom data contract & service class to create an inbound port in AX. This service will accept the data and store it in staging tables so that other functionalities can use the data for various postings.
  2. Creating .net web service (mid-tier): One can create a simple web service in asp.net using C#. In this service, one will add a reference to the AX web service we created in point (1) above. In addition, one needs to use third-party dll for serializing the received JSON values to AX SOAP xml format. Hosting this service and sharing the service url with third-party dev so that they can consume it and send across the JSON data.

Error handling:

This is a very important aspect in this whole process. If we do not have proper error handling in place then be prepared to spend hours in identifying the issue and long delay in fixing the same. We will break the error handling points as below:

  1. JSON formatting error: Most of the dll that you are going to use for serialization itself will handle this. So make sure this code is inside ‘try-catch block’. In addition, there needs to be a mechanism in place to communicate the ‘error to caller’ based on specific requirements.
  2. Data error: Best would be to get this handled at AX level. In AX, we already have ‘service and contract’ objects where you can have a validation in place, which checks the incoming data. Also, we need to make sure that the error raised by AX propagates to the caller via .net utility web service.

Once everything is in place the integration is ready for testing, and thereafter for production. It goes without saying that to solve one problem there are numerous solutions, but one has to pick a solution, which seems feasible depending upon the requirements.

                                                                                                                                                                                                                               Author: Puneet Darji

 

Related Topics:

About Alletec

Alletec has been a leading provider of Business Technology Solutions & IT Services to Growth Companies since 2000. Recognized consistently by Microsoft to be amongst their Top Microsoft Dynamics 365 Partners in India, Alletec has been part of the global elite Microsoft Dynamics Inner Circle and President's Club. Working with customers in India, APAC, Hong Kong, Europe, USA, Africa and Middle-East, the company has helped companies across various industries in their Implementation and upgradation of Microsoft products. 

10 comments

posted by mastermindtechies
Wednesday, 15 May 2019 10:28

Thanks for sharing this insight information http://mastermindtechies.com/

posted by mastermindtechies
Friday, 26 April 2019 13:15

if there any updates, please posted and thanks for sharing...!!!!!!!!!

posted by mastermindtechies
Wednesday, 27 March 2019 09:17

Thanks for sharing...!!!!

posted by Bao
Thursday, 28 June 2018 09:53

Gǎnxiè nín shǐyòng JSON gòngxiǎng yǒuguān Dynamics AX yǔ PHP yìngyòng chéngxù jíchéng de yǒuyòng xìnxī

posted by Kendall
Thursday, 03 May 2018 06:51

This method is really awesome thanks for sharing this. I would love to know more about this kind of unique methods.

posted by Mitsubishi
Thursday, 03 May 2018 06:50

Thanks for sharing this valuable information.

posted by Evan Kirstel
Thursday, 22 March 2018 06:34

Really a nice blog. I am bookmarking your site for more information like this. I am a functional consultant and this article really helped me in know this new method of PHP integration in Dynamics AX using JSON.

posted by Rhea Mathur
Thursday, 22 March 2018 06:32

Hi,
I am looking for Microsoft Dynamics AX Implementation in my company. It would be really grateful if you could help me connect with some consultants who can guide or help and support in the implementation process.
Thanks,
Rhea

posted by David Russel
Thursday, 22 March 2018 06:30

This method of PHP integration in Microsoft Dynamics AX is really easy. It saved a lot of time for me.
Cheers. keep sharing useful stuff like this.

posted by Kevin James
Thursday, 22 March 2018 06:28

Really helpful article for Dynamics AX integration with PHP application. Thanks for sharing this valuable information.

Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

What is the sum of ?
+
=
More in this category:

Partner



Global Presence
India
Australia
US
 

latest from twitter

In the latest Azure Data Studio update, the cross-platform data management tool got a new community extension, Note… https://t.co/RU9zqOPyJ8

Microsoft’s official Power BI app got new updates like support for custom app navigation for both Android and iOS v… https://t.co/OCop1Kkzxb

Microsoft has released updated tools for its Office 365 and Microsoft Azure solutions. The latest being a new tool… https://t.co/o8XNAoDnIL

Microsoft has released a new version of Azure Storage Explorer 1.10.0. The latest version offers various new featur… https://t.co/z1GtXV2GYb

Contact Address

  A-1, Sector - 58, Noida - 201 301, India
  +91(0) 120 3000 300
  info@alletec.com

Follow Us