web
You’re offline. This is a read only version of the page.
close
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.

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    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?

  • PK mishra Profile Picture
    115 on at

    Errors:-

    Errors

    above 3 errors is coming......

  • PK mishra Profile Picture
    115 on at

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

    Above 3 error is coming. 

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    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

    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,160 Moderator on at

    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

    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.

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    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. 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 464 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans