AIF service modification - AIF complains about invalid child element

I wrote a query backed AIF service that i have since modified. I added fields to the underlying tables that the query uses, restored the query, refreshed the AIF service ( basic > AIF > services > refresh(button) ) then updated the document service (ax > tools > development > aif > update document service) and regenerated the data object classes and updated the AxBC classes.

when i attempt to process in a test document with the new document schema, i get an error that the child element doesn’t exist. I have checked the document schema and the element exists there, its in the query, and its enabled on the action data policies for the service. the only thing that stands out to me is that the endpoint action data policies for the service aren’t in what i would classify as the correct order. i would expect to something like this (in the xpath column)…

(standard aif xpaths)
parent/field1
parent/field2
parent/field3
parent/child/field1
parent/child/field2
parent/child/field3

but what i see is this:

parent/field1
parent/field2
parent/child/field1
parent/child/field2
parent/field3
parent/child/field3

and it just so happens the element that is throwing the error is parent/field3. the exact error is (names removed)…

Invalid document schema. The following error was returned: The element ‘field3’ in namespace ‘’ has invalid child element ‘PaymMode’ in namespace ‘’. List of possible elements expected: ‘’ in namespace ‘’.

any suggestions?

Hi,

From your example, I am finding it difficult to understand the order in endpoint action data policy.

But please note that AX by default will try to order the elements alphabetically. Most likely in your case, this is what you will find. Please can you confirm this?

If this is the case, then you may have to rename the fields to suit your requirement.

I think i figured out my issue. The issue wasn’t with the AIF service itself but with the test document i was using. For all the parent elements, manually modifying the file to so the elements are in alphabetical order seems to have fixed the issue.

before i figured this out, i removed all references to the service in all companies then deleted out all of the services related items then imported them back in with new IDs and added the service and references back but still got the same error.

so, long story short, when you create a test file for an AIF service, keep the elements in alphabetical order