Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

'Error while deserializing contract class' issue

(0) ShareShare
ReportReport
Posted on by 5

I made a Json Object like this:

.{

"_Cmd": [
{
"Description": "Ceci est un test",
"ypeNote": "test",
"teExpe": null,
"City": "Paris",
"CodeRep": "FTRTY",

"TypeRegroupement": {
"Description": "Ceci est un test",
"Type": "Thiers"
},
"ZipCode": "92100"
}
],
"_Ligne": [
{
"Price": 67.0,
"NumLine": 1.0,
"QtyCmd": 0.0,
"IsCoupe": false,
"RefCom": "TYGUUJH"
}
],
"_Doc": [
{
"Description": "this is a test",
"TypeNote": "Test"
}
]
}

My API wait for this three parameters

But When I use soap UI and i made post request this Json i have this message : 

"Message": "An exception occured when deserializing a parameters - Exception occurred when parsing and deserializing parameter '_Cmd' - 'Error while deserializing contract class'",

But my Json Is valid. 

What can I do ?

  • Martin Dráb Profile Picture
    233,025 Most Valuable Professional on at
    RE: 'Error while deserializing contract class' issue

    First of all, let me re-post your JSON code in the right way. Next time, please don't forget to use Insert > Code (in the rich formatting view).

    {
    	"_Cmd": [
    		{
    			"Description": "Ceci est un test",
    			"ypeNote": "test",
    			"teExpe": null,
    			"City": "Paris",
    			"CodeRep": "FTRTY",
    
    			"TypeRegroupement": {
    				"Description": "Ceci est un test",
    				"Type": "Thiers"
    			},
    			"ZipCode": "92100"
    		}
    	],
    	"_Ligne": [
    		{
    			"Price": 67.0,
    			"NumLine": 1.0,
    			"QtyCmd": 0.0,
    			"IsCoupe": false,
    			"RefCom": "TYGUUJH"
    		}
    	],
    	"_Doc": [
    		{
    			"Description": "this is a test",
    			"TypeNote": "Test"
    		}
    	]
    }

    Now we know what you're sending, but not what your code expects, which is cricial to know if we're identify how these two things differ. Please show us your contract class (for the _Cmd property) and code that you're using to deserialize the JSON string to an instance of your contract class.

    Also, tell us how you've implemented the web service. AX 4.0 doesn't have any support for custom services, therefore it isn't clear how you've done it.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 294,336 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,025 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans