locked
Hitting the maximum size for the deserialization of the Execution Context within the Sandbox Plugin RRS feed

  • Question

  • Hi,

    I recently have hit an issue around the use of a default plugin for MS Dynamics CRM Online.  Using the plugin registration I completed the following steps: -

    • Created a service endpoint.
    • Added a step to this endpoint that was listening for updates to any entities.
    • Added an image to capture pre and post states of this entity.

    When integrating this with a customized solution, the following error was being received.

    Plugin Trace:

    [xrm.xRMPlugin: Microsoft.Crm.Sdk.Samples.SandboxPlugin]
    [1a51d51a-08de-e011-8ded-1cc1de08d711: Microsoft.Crm.Sdk.Samples.SandboxPlugin: Update of  any Entity]
    Posting the execution context.
    Exception: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.microsoft.com/xrm/2011/Contracts:executionContext. The InnerException message was 'There was an error deserializing the object of type Microsoft.Xrm.Sdk.RemoteExecutionContext. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 892.'.  Please see InnerException for more details. (Fault Detail is equal to Microsoft.Xrm.Sdk.OrganizationServiceFault).

    ----------------------------------------------------------------------------------------------------------------------------------------------------------

    Google returned issues around deserialized messages when using WCF.  I couldn't find any issues with deserializing messages on CRM forums. 

    Has anyone heard/encountered this issue before?  Are there are ways to deserialize the execution context when the 8192 (I presume 8MB) limit has been exceeded within the Online solution?

    Thanks in Advance,

    Jim

     


    Jim - www.jamesmcguigan.co.uk
    Sunday, November 6, 2011 11:07 PM

Answers

  • The following portion of code was placed in our target application.  This removed any errors regarding the initial question raised.

     

    raised.WS2007HttpRelayBinding binding = new WS2007HttpRelayBinding();

    binding.Security.Mode = EndToEndSecurityMode.Transport;

    XmlDictionaryReaderQuotas myReaderQuotas = new XmlDictionaryReaderQuotas();

    myReaderQuotas.MaxStringContentLength = int.MaxValue;

    myReaderQuotas.MaxArrayLength = int.MaxValue;

    myReaderQuotas.MaxBytesPerRead = int.MaxValue;

    myReaderQuotas.MaxDepth = int.MaxValue;

    myReaderQuotas.MaxNameTableCharCount = int.MaxValue;

    binding.GetType().GetProperty("ReaderQuotas").SetValue(binding, myReaderQuotas, null);

    Enjoy!

     



    Jim - www.jamesmcguigan.co.uk
    Tuesday, November 29, 2011 11:01 AM

All replies

  • Hi Jim,

     

    I got this error message as well sometime ago when importing a silverlight webresource while having an update of any entity plugin registered. I just disabled the plugin, ran the import & then  re-enabled the plugin.

     

    My Silverlight app was around 2MB in size after I reduced it in size to about 1MB i no longer had to disable the plugin.

     

     

    Thanks

     John

    Monday, November 7, 2011 9:08 AM
  • Hi John,

     

    Just saw your response.  We coded in a fix for this.  I will post the solution online tomorrow.

     

    Thanks,

     

    Jim


    Jim - www.jamesmcguigan.co.uk
    Thursday, November 24, 2011 10:15 PM
  • The following portion of code was placed in our target application.  This removed any errors regarding the initial question raised.

     

    raised.WS2007HttpRelayBinding binding = new WS2007HttpRelayBinding();

    binding.Security.Mode = EndToEndSecurityMode.Transport;

    XmlDictionaryReaderQuotas myReaderQuotas = new XmlDictionaryReaderQuotas();

    myReaderQuotas.MaxStringContentLength = int.MaxValue;

    myReaderQuotas.MaxArrayLength = int.MaxValue;

    myReaderQuotas.MaxBytesPerRead = int.MaxValue;

    myReaderQuotas.MaxDepth = int.MaxValue;

    myReaderQuotas.MaxNameTableCharCount = int.MaxValue;

    binding.GetType().GetProperty("ReaderQuotas").SetValue(binding, myReaderQuotas, null);

    Enjoy!

     



    Jim - www.jamesmcguigan.co.uk
    Tuesday, November 29, 2011 11:01 AM