Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

AIF throws error Invalid document schema, The required attribute 'class' is missing when call from Boomi Cloud Atom

Posted on by 1,600

Hi Friends,

I am currently working to integrate AX 2012(R3) with Salesforce by using Dell Boomi. I am getting XML validation error while trying to create customer data in AX. 

I have configured the flow as given in Boomi document. Please check the steps below

Steps:

1) Installed Local Boomi Atom on the AOS server and it is running as expected.

2) Installed web services for AIF in IIS as per Boomi Guide and working as expected.

3) Created a HTTP Inbound Port as per the Boomi Guide line here and used for Customer(Standard CustCustomerService).

4) I have enabled the Data Policies, to get only limited XML elements which needs for the Integration.

5) In Boomi, We have created a new test environment and attached the local atom which installed in DEV AOS.

6) Created new Connection using Microsoft Dynamics AX connector as explained.

7) Created new Operation for both READ and CREATE as explained.

8) After all this configuration done, I can successfully communicate with AX.

9) READ Operation retrieved data as expected.

10) CREATE Operation has been failed and throw XML validation error.

  • BOOMI - XML ERROR

Boomi_5F00_CreateError.JPG

  • BOOMI - CREATE OPERATION PARAMETER

Boomi_5F00_ConnectorValues.JPG

  • BOOMI - CREATE XML ATTRIBUTE (This is created based on the AX service I have selected)

Boomi_5F00_CreateXMLAttribute.JPG

  • AX - XML EXCEPTION (Invalid document schema. The following error was returned:  The required attribute 'class' is missing.)

AX_5F00_InboudException.JPG

  • AX - INBOUND XML

AX_5F00_InboudXML.JPG

I don't know what could be the reason for this error and what to pass in the @CLASS attribute. 

Please let me know if anyone already faced issues like this or working in Dell Boomi.

Thanks in Advance!

// Vasanth Arivali

  • Suggested answer
    VasanthArivali Profile Picture
    VasanthArivali 1,600 on at
    RE: AIF throws error Invalid document schema, The required attribute 'class' is missing when call from Boomi Cloud Atom

    Hi Nikolaos,

    Thanks for you help!

    I have found the root cause of the issue. It is not in the XML but in our AXD class code.

    I tried to pass the Dirparty Element name / type to AxdEntity_DirPartyTable_DirOrganization to initiate DirPartyOrganization class during the create operation based on this link (community.dynamics.com/.../using-aif-to-import-vendors-error-document-does-not-support-the-axdirpartytable-class). But failed to do from Boomi.

    Then I found a blog post to add our custom classes code logic in the service classes (sanartham.blogspot.com/.../item-service-in-ax-2012-this-document.html).

    Standard AX AXDCustomer class worked based on DirPartyOrganization element not with DirParty. From Boomi, AX Service only showing DirParty Table and a root element of DirParty related fields. So I have added new switch case for DirParty in AXDCustomer & DirPartyServiceOp classes.

    1) AXDCustomer -> prepareForSaveExtended()

    This is to link DirParty to Customer, Standard uses DirPerson & DirOrganization. I have added one more if block to get details from DirParty object.

          Change 1:

          // Handle customer logic

           case classnum(AxCustTable) :

               axCustTable = _axBcStack.top();

               // Save after party id

               if(_recordProcessingContext == AxdRecordProcessingContext::AfterChildRecordProcessed)

               {

                   if (classidget(_childRecord) == classnum(AxDirPerson))

                   {

                       // Assign the party again

                       axDirPerson = _childRecord;

                       axCustTable.parmParty(axDirPerson.parmRecId());

                       return true;

                   }

                   else if (classidget(_childRecord) == classnum(AxDirOrganization))

                   {

                       // Assign the party again

                       axDirOrganization = _childRecord;

                       axCustTable.parmParty(axDirOrganization.parmRecId());

                       return true;

                   }

                   else if (classidget(_childRecord) == classnum(AxDirPartyTable))     -------------------> added by me

                   {

                       // Assign the party again

                       axDirPartyTable = _childRecord;

                       axCustTable.parmParty(axDirPartyTable.parmRecId());

                       return true;

                   }

               }

          Change 2:

           // Handle party logic

           case ClassNum(AxDirPartyTable) :  ------> added by me

           case classnum(AxDirPerson) :

           case classnum(AxDirOrganization) :

           case classnum(AxDirPersonName) :

           case classnum(AxDirOrganizationName) :

               return DirPartyServiceOp::handlePartyOperations(_axBcStack, _dataSourceName,

                   _recordProcessingContext, _childRecord);

    2) DirPartyServiceOp -> processSaveForDirParty()

    Here I have duplicated the switch case block

                         case classNum(AxDirOrganization):

    and created new block before default case and passed DirParty element values to DirOrganization object.

              case classNum(AxDirPartyTable) :

                        axDirParty = _axdStack.top();

                        axDirOrganization = new AxDirOrganization();

                        axDirOrganization.parmPartyNumber(axDirParty.dirPartyTable().PartyNumber);

                        axDirOrganization.parmName(axDirParty.dirPartyTable().Name);

                        // We need to check about the existing party number for one event only

                       switch (_recordProcessingContext)

                       {

                          standard code....

    Then done Update Service Documents, Refresh Service and Full CIL to make sure no errors.

    After this, I can successfully created Customer and it related details in AX from Boomi.

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: AIF throws error Invalid document schema, The required attribute 'class' is missing when call from Boomi Cloud Atom

    Please try to get the schema for the create operation for AX. It describes you the required format for the message.

  • VasanthArivali Profile Picture
    VasanthArivali 1,600 on at
    RE: AIF throws error Invalid document schema, The required attribute 'class' is missing when call from Boomi Cloud Atom

    Hi Nikolaos,

    Thanks!

    I found the way to key the value in Boomi for @Class attribute and the error gone now.

    But got another issue.

      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns4:CustomerServiceCreateRequest xmlns:ns4="schemas.microsoft.com/.../services">
    - <ns5:Customer xmlns:ns5="schemas.microsoft.com/.../Customer">
    - <ns5:CustTable class="entity">
      <ns5:Currency>SGD</ns5:Currency>
      <ns5:CustGroup>TR-LOCAL</ns5:CustGroup>
      <ns5:TaxGroup>GST-7%</ns5:TaxGroup>
    - <ns5:DirParty class="entity">
      <ns5:Name>BoomiTest1</ns5:Name>
      </ns5:DirParty>
      </ns5:CustTable>
      </ns5:Customer>
      </ns4:CustomerServiceCreateRequest>

    AX_5F00_InboudExceptionAXDirparty.JPG

    Do you have any idea on this?

    I referred you answer here and tried community.dynamics.com/.../1111587

  • Verified answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: AIF throws error Invalid document schema, The required attribute 'class' is missing when call from Boomi Cloud Atom

    You need to pass class="entity" attribute. So now you know what kind of message you must send to AX. The AX part is therefore clear.

    How to add that attribute in Boomi is another question, but I think that question must be asked on Boomi forums, since that part is not related to AX at all.

  • VasanthArivali Profile Picture
    VasanthArivali 1,600 on at
    RE: AIF throws error Invalid document schema, The required attribute 'class' is missing when call from Boomi Cloud Atom

    Hi Nikolaos,

    Thanks for your Response!

    I understand the problem, my XML file does not has the class attribute(when call from Boomi).

    This XML elements are standard and created automatically in Boomi when I selected the Service. I have found a way to test by passing STATIC parameter to those and call AX for READ. I tried the same approach and passed value in the Connector configuration but don't know how / what to pass the @class attribute.

    That is where I lost, I have tired many options noting worked. Do you have any idea on that?

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,148 on at
    RE: AIF throws error Invalid document schema, The required attribute 'class' is missing when call from Boomi Cloud Atom

    Hi Vasanth,

    this issue has nothing to do with Dell Boomi, it's a problem in the message that you're trying to send to AX.

    Anyway, I typed "AX 2012 AIF sample message" in a search engine and found this documentation for you: docs.microsoft.com/.../example-create-action

    It will answer your question.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans