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 :
Microsoft Dynamics AX (Archived)

Not able to send large image files through AIF

(0) ShareShare
ReportReport
Posted on by 65

Hi,


I have to send an image of size 200kb and 1000kb from .net application to AX and vice versa through AIF.

When I use HTTP protocol, if return type is byte[] or memory stream or string.

It is throwing following error, when I try to send image of size 200kb image:
The remote server returned an unexpected response: (413) Request Entity Too Large.

Using TCP protocol, it is throwing following error, when I try to send 1000kb image:

{System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org:_imageArr. The InnerException message was 'There was an error deserializing the object of type System.Byte[]. The maximum array length quota (524288) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.'. Please see InnerException for more details. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.ServiceModel.Dispatcher.NetDispatcherFaultException: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org:_imageArr. The InnerException message was 'There was an error deserializing the object of type System.Byte[].

The maximum array length quota (524288) has been exceeded while reading XML data.
This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object
used when creating the XML reader.'. Please see InnerException for more details. ---->

System.Runtime.Serialization.SerializationException: There was an error deserializing the object of type System.Byte[]. The maximum array length quota (524288) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the...).}

Please suggest me any solution.

Thank you

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at

    You have several options. You can simply change configuration to accept larger files (you can see some hints directly in error messages; more in WCF documentation). Or you use streaming (yes, it is supported even by custom services hosted by AX 2012 AOS).

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans