Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Invalid message schema error while create sales order XML file through AIF (File System Adapter)

(0) ShareShare
ReportReport
Posted on by 115

while creating sales order XML file through AIF (File System Adapter) IN Folder, Invalid message schema error is coming .

below is my XML:

<?xml version="1.0" ?>
<Envelope xmlns = "https://schemas.microsoft.com/
dynamics/2011/01/documents/Message">
<Header>
<Action>https://schemas.microsoft.com/
dynamics/2008/01/services/
SalesOrderService/create</Action>
</Header>


<Body>
<MessageParts xmlns = "https://schemas.microsoft.com/
dynamics/2011/01/documents/Message">
<SalesOrder xmlns = "https://schemas.microsoft.com/
dynamics/2008/01/documents/SalesOrder">
<DocPurpose>Original</DocPurpose>

<SalesTable class="entity">
<CustAccount>ACUS_0000001</CustAccount>
<InventLocationId></InventLocationId>
<CustomerRef>Cash on Delivery (COD)</CustomerRef>
<PurchOrderFormNum>4669286216,1021</PurchOrderFormNum>
<ReceiptDateRequested>2021-02-16</ReceiptDateRequested>
<InventSiteId>MUMCOR</InventSiteId>

<TableDlvAddr class="entity">
<City>southbank</City>
<CountryRegionId>AUS</CountryRegionId>
<LocationName>delivery address</LocationName>

</TableDlvAddr>
<SalesLine class="entity">
<ItemId>CI1003</ItemId>
<SalesQty>42</SalesQty>
<SalesPrice>111</SalesPrice>
<SalesUnit>Quantity</SalesUnit>
<LineAmount>1000</LineAmount>

</SalesLine>
</SalesTable>
</SalesOrder>

</MessageParts>
</Body>
</Envelope>

Any help would be appreciated:-

Thanks.

  • Verified answer
    nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: Invalid message schema error while create sales order XML file through AIF (File System Adapter)

    Let's focus in the schema here. Please post a new question about the permission issue.

    Please validate your xml against the schema with some online tool. When it passes, it's good for importing to AX. 

  • PK mishra Profile Picture
    115 on at
    RE: Invalid message schema error while create sales order XML file through AIF (File System Adapter)

    Yes , I did test ,when i import this file ,both 2 errors is coming .

    1- Invalid schema.

    2- Failed to create a session,confirm that user have proper privileges to log onto Microsoft Dynamics.

  • Suggested answer
    nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: Invalid message schema error while create sales order XML file through AIF (File System Adapter)

    Did you test with the new XML? I assume the exceptions are not even related to your import of this file. If permissions are not ok, the file is not read and you wouldn't see schema error.

  • PK mishra Profile Picture
    115 on at
    RE: Invalid message schema error while create sales order XML file through AIF (File System Adapter)

    Now I have got below 2 error :-

    1- Invalid schema.

    2- Failed to create a session,confirm that user have proper privileges to log onto Microsoft Dynamics.

    & My current XML Is:

    -

    
    
    {e552ddcc-687c-4799-9c70-11b30115bb7e} https://schemas.microsoft.com/dynamics/2008/01/services/SalesOrderService/create
    Original ACUS_0000001 Cash on Delivery (COD) MUMCOR 4669286216,1021 2021-02-16 B2B CI1003 1000 111 42 Quantity
     

    & my current Endpoint schema is:-

    
      
      
      
        
          
        
      
      
        
          
          
          
          
          
          
          
          
          
          
        
        
        
      
      
        
          
          
          
          
          
          
          
        
        
        
      
      
        
          
        
        
        
      
      
        
          
        
        
        
      
    

  • Suggested answer
    nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: Invalid message schema error while create sales order XML file through AIF (File System Adapter)

    Hi,

    next time when you share code, could you please click "Use rich text formatting" -> "Insert" -> "Code" so that it's readable. Thanks!

    Anyway, in the exception log we can see that you might have issues with:

    1) File encoding vs contents (since you originally just pasted the xml contents here, we have no way of investigating it)

    2) User rights - file owner, folder permissions, AOS service account might have some problems

    3) And your XML is not corresponding to the schema. This I can see just by looking at the schema. In your message you have for example CustAccount, InventLocationId, CustomerRef. But according to the schema, InventLocationId is not expected/allowed between CustAccount and CustomerRef.

  • PK mishra Profile Picture
    115 on at
    RE: Invalid message schema error while create sales order XML file through AIF (File System Adapter)

    8203.WhatsApp-Image-2021_2D00_02_2D00_19-at-7.15.04-PM-_2800_6_2900_.jpeg

    Above 3 error is coming. 

  • PK mishra Profile Picture
    115 on at
    RE: Invalid message schema error while create sales order XML file through AIF (File System Adapter)

    Errors:-

    Errors

    above 3 errors is coming......

  • Suggested answer
    nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: Invalid message schema error while create sales order XML file through AIF (File System Adapter)

    Do you see any details in the exception log? I would assume it will tell you what's wrong with the schema. For example the elements in your XML file might be in different order than in the schema file.

    If you need more help, could you share the schema of this endpoint?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,276 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,975 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans