
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)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).