AIF – Invalid Message Schema … ??

If you ever encounter this error message in Ax4sp2 and you are one hundred procent certain that there is nothing wrong with your file, check the MessageId tag. This sequence can not just be increased by one all the time, sometimes you come to a combination which simply does not compute..


In \Classes\AifMessage, there is a method called validateGuid() which is called each time an incoming message is read. If in error, this routine throws “The string ‘%1’ is not a valid GUID”, but that is later replaced with “This message cannot be imported: AifGatewayQueue Invalid Message Schema” … !?

After checking my file several times, I started to trace through AIF import handling and found this. Again, might save you some time if you get the same problem. Simply put a breakpoint in validateGuid() method and see how your code goes.

Below simple example shows how you can generate a Guid which will work. Since input and output queues are using different lists, a guid generated inside ax can be used for import right after (just did).

1
2
3
4
5
6
7
8
9
static void FO_NewGuId(Args _args)
{
    guid myGuid;
    ;
 
    myGuid = newGuId();
    print strfmt("The GUID is: %1", myGuid);
    pause;
}

Last 5 posts in DAX 4.0 SP2

2 thoughts on “AIF – Invalid Message Schema … ??

  1. Yes I did that also in the beginning, but often it failed still and do the process over and over when you are tracing a specific part of the code got tedious, to say the least.. above method always generate a correct code. /Henrik

Leave a Reply

Your email address will not be published. Required fields are marked *