jeudi 25 août 2016

Need to create Web Service in AX 2012 AIF that returns somewhat complex XML

We need to create a web service in AX 21012 that will return somewhat complex XML to the calling application.

For example, we need to return specific information of a company (and its sub-companies) via a web service from XML. This is one of the many types of data we need to return to other applications that will connect to AX via AIF, hence the somewhat complex XML!

The approach we are trying to use is creating custom classes that will hold the data, and then try to convert (serialize) the classes into XML. This normally would be pretty easy with C# but we can into road-blocks in trying to get the Type of an object. We also tried using "implements AifXmlSerializable" but then we ran into issues with deploying the service group.

We tried using String as the return value in AIF with limited success, basically build our own XML line by line and then send it through, but this is cumbersome and error prone. We were successful in using List in AIF, but the data we return will be more complex than that.

Any ideas or links to example code on how to do this will be HUGELY appreciated!




Aucun commentaire:

Enregistrer un commentaire