Monday, November 23, 2015

The formatter threw an exception while trying to deserialize the message Ax2012

Today I received below error first while deploying report then while viewing it:
The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:queryBuilderArgs. The InnerException message was 'Element 'http://tempuri.org/:queryBuilderArgs' contains data from a type that maps to the name 'http://schemas.datacontract.org/2004/07/XppClasses:SrsReportProviderQueryBuilderArgs'. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to 'SrsReportProviderQueryBuilderArgs' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'.  Please see InnerException for more details.

The solution to this was:
1. Delete all records from SysClientSessions.
2. Restart AOS.
3. Restart SSRS.
4. If above steps don't work then you can also try deleting the existing report and redeploying. Or deleting AUC files. And also deleting the XPPIL folder and performing full CIL.

Or the best way when you face this error in production environment and cannot take a downtime:
Just deactivate and re-activate the BIServices Inbound Port and the magic is done.

Source:
https://community.dynamics.com/ax/f/33/t/112982