web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

JSON Object deserialized in D365

(3) ShareShare
ReportReport
Posted on by 71

I'm experiencing the same results in code and Postman.   To keep it simple in the body of a Postman I have a JSON array - let's say the array has (1) = "A" and (2) = "B".  In the X code it shows the data as (1) = "B" and (2) = "B".   The last entry is duplicated to all others entries.  The X code is expecting a list.  The X code was originally written to accept SOAP objects and they work as expected.

I have looked at the header body in Fiddler and it looks correct.   All array elements are unique.

If I look at the data members in the ScanWorkX_QueryBuildDataSource class, they are set to the values I would expect,  each element of the JSON array comes over.  

.  

 [AifCollectionTypeAttribute('_SWXQueryDataSources', Types::Class, classStr(ScanWorkX_QueryBuildDataSource))]//, SysEntryPointAttribute]
    public str ExecuteQuery(List _SWXQueryDataSources, boolean _crossCompany = false)
    {
    ..... code
    }

 

 

Where else can I look to see how the elements are being put together?  

Does the Web API need to be setup from a Service Group / Service perspective different than SOAP?

A single JSON array element comes across and is processed properly.

 

any assistance is appreciated.

Thanks

Duane

Categories:
I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi DDMoore,

    It seems that your issue is related to D365 AX, please post it at here for further help:

    Microsoft Dynamics AX - Forums, Blogs, Support

  • TonyK Profile Picture
    2 on at
    As this is one of the only search results for this problem in D365 FinOps, we just had the same problem and found a "solution".  One specific json array in the message is deserialised into a List with the correct number of elements but all have the data from the last.

    We are using many custom services with collections of objects, it is only this one data contract that has the problem.  We "fixed" it by creating a new data contract that extends the problematic one and using it as the type in DataCollectionAttribute and AifCollectionTypeAttribute.  Renaming the contract class itself was not sufficient.
  • Layan Jwei Profile Picture
    8,165 Super User 2026 Season 1 on at
    The question content is empty
  • Martin Dráb Profile Picture
    239,559 Most Valuable Professional on at
    Unfortunately, a question body sometimes disappears when moving a thread between forums - and it happened here too.
    I reported the bug a few times and I also notified admins about this particular thread, asking them to restore the text if possible.
  • Bret Fraser Profile Picture
    Community Manager on at
    Hi @Martin,
     
    Thank you for keeping posts in the right forums 👍- we have restored the original text of this thread, and our engineering team is reviewing alternate methods for moderators to move posts between forums so that we don't see this issue anymore.
     
    thanks for all your good work in the community!
     
    Bret

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 661 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 620

#3
Subra Profile Picture

Subra 473

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans