AIF Queries & Schemas: A Picture is Worth a Thousand Words


 A while back I created this graphic to show the relationship between a document query and the document schema. If you’re new to AIF, this may help you understand the format of the data that flows in and out of AIF through the document services.


 


When using a document service in AIF, you call a service operation such as SalesOrder.read to read the sales order. When the service operation is called, the service passes this request to the Axd<Document> class, in this case AxdSalesOrder. The document class is based on a query, in this case the query is also called AxdSalesOrder. The query defines the schema for the document. So when the sales order data is sent from AX back to the calling system in XML, the structure of the XML matches that of the source query.


 


The attached image shows you the XML elements and how they map to the elements in the source query. The document itself is “SalesOrder” while each data source in the query has an “entity” attribute. (Normally, I would link to the graphic but I encountered what we like to call “challenges” when uploading the file.)


 


Hopefully this elucidates the XML document structure and will help you in troubleshooting.

AIFQueryToSchema.jpg

Comments (1)

  1. Amber says:

    I have a situation where our DEV environment generates the XSD based on the order of the fields in the service query. In our TEST environment, it generates the XSD based on the order of the fields in the table object. Any ideas? So now, when we're trying to test with our 3rd party, all the fields are out of order. We can ask them to send a different format, but how can we be sure which format PROD will require?? We need to understand why it's doing this.

    Please help!