Friday 17 January 2014

Development Tips on Application Integration Framework

I have read one article before start development of  AIF. Check the following links

http://axblog4u.wordpress.com/2010/11/23/development-tips-on-application-integration-framework/

http://blogs.msdn.com/b/aif/archive/2012/05/07/how-to-serialize-int-real-properties-with-0-0-00-values-via-aif-outbound-integration.aspx

http://www.dynamics101.com/2013/11/creating-custom-inbound-aif-service-microsoft-dynamics-ax-2012/

Thursday 16 January 2014

Inbound port of AIF Ax2012 using File system Adapter

Few things must be noted: ( Inbound port of AIF Ax2012 using File system Adapter )
If your client/Other vendor  has given you XML . They want to import in to AX using AIF. Don’t try to import that xml  according to standard schema of that service.
You must change customize schema from Data Policies inbound port according to you xml tags.
After change of Data Policies you must change your XML tags according to sequence of Data Policies enabled fields.
Generate XML according to standard  XML schema  of  AX
You can check schema nodes related to your action from AX  then mention all nodes in your XML.
Do you want to find all active and deactivate service in Ax ?Fallow the following path





Error 1:
Solution:
Such type of error arise when you xml file come's from BizTalk server and your xml tag contain
instead of
so change it into
OR
When you have found above type error then you can go to the following path

Check the xml output fault message in above path and here you can find some fields tags are missing according to standard schema
The tag '/LedgerGeneralJournal/SenderId' is not allowed; it must be removed or marked null.


Error 2:  Invalid document schema. The following error was returned:  Could not find schema information for the element.
Solution: you can verify your XML tags according to your XML schema from Data Policies.

Error 3:  The tag '/LedgerGeneralJournal/DocPurpose' is not allowed; it must be removed or marked null.
Solution: you can verify your XML tags according to your XML schema from Data Policies. Or just pass null for that tag in your XML.
Error 4:  An error has occurred in the services framework. Method: AifMessageInspector::AfterReceiveRequest. Error: System.ServiceModel.FaultException`1[Microsoft.Dynamics.Ax.Services.AifFault]: Request Failed. See the Exception Log for details. (Fault Detail is equal to Microsoft.Dynamics.Ax.Services.AifFault.


Solution: Check the following screen and configure your service according to these number 1 and check your accurate issue in number 2 path
Error 5: 
Stack trace: The company  does not exist.

Solution:
I am using standard Schema of XMl when I am facing above issue. So I have modified my XML schema from data policies and enable that filed in my schema, add new tag of company filed in my XML.
Error 7:   This is an invalid xsi:type 'AxdEntity_CustInvoiceLine'
Solution: Check your service XML Schema and change tag according to Schema.
Error 8:   Account and offset account cannot be the same
Solution:
If XML contain same value in tags of account and offset account then you can face above issue.
Be make sure both  account number and offset account value is change(i.e Account number = 0101 and offset account = 0102).
Error 9: The request failed with the following error:  Invalid document schema. The following error was returned:  Could not find schema information for the element.
Solution:
When you are putt wrong tags according to schema. Check Data Policies on inbound port form and verify your XML tags according to schema.
Error 10: The request failed with the following error:  Object reference not set to an instance of an object
Solution: When you are putt wrong tags according to schema. Check Data Policies on inbound port form and verify your XML tags according to schema.
Or
If your any tag of xml has wrong data according to destination system table data filed data . then verify you are xml data and your destination system data  

also check this link
http://mybhat.blogspot.com/2013/03/aif-object-reference-not-set-to.html

Error 11: The following error was returned:  The required attribute 'class' is missing
Solution:
Verify your XML file according to your XML Schema.
Error 12: The request failed with the following error:  Duplicate message. Message has already been processed.
Solution:
If your xml file contain same message id which one you have already import in Ax.Only change the message id value at the end of id i.e
{5603D03A-4380-404D-9F27-738BE0FEA14F} already inserted message
Change it as following
{5603D03A-4380-404D-9F27-738BE0FEA18F}
Error 13: Error found when validating record
Solution:
Such type of error occurred. When you’re XML tags contain different value than Ax setup value
For example Ax setup value is following
1102
Your XML contain following value
1111

Error 14: The request failed with the following error:  Creation has been canceled.
Solution:  Such type of error occur when your xml mandatory tag is missing in your xml file