web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Bret Fraser Profile Picture
    Community Manager on at
    JSON Object deserialized in D365
    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
  • Martin Dráb Profile Picture
    236,206 Most Valuable Professional on at
    JSON Object deserialized in D365
    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.
  • Layan Jwei Profile Picture
    8,034 Super User 2025 Season 2 on at
    JSON Object deserialized in D365
    The question content is empty
  • TonyK Profile Picture
    2 on at
    JSON Object deserialized in D365
    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.
  • Community Member Profile Picture
    on at
    RE: JSON Object deserialized in D365

    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

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,317

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 656 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans