function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nello_THnello_TH 

actionFunction call hanging/slow response passing xml string parameter

We have come across an issue when using an actionFunction in a Visualforce page. I have created the following test code to demonstrate the issue:

 

public with sharing class XmlTestPage_Controller {
	
	public transient String SaveDraftXml { get;set; }
	
	public PageReference saveDraftAction(){
    	System.debug('** Draft xml! :'+SaveDraftXml);
    	System.debug('** String length :'+SaveDraftXml.length());
		return null;
    }
    
}

 

<apex:page controller="XmlTestPage_Controller">
	
	<apex:form >
	
		<script type="text/javascript">
			function save(){
				var draftxml = document.getElementById('xmlInput').value;
				saveDraftAction(draftxml);
	        }
    	</script>
	
		<apex:actionFunction name="saveDraftAction" action="{!saveDraftAction}" reRender="none" oncomplete="alert('Saved!');">
	        <apex:param name="SaveDraftXml" assignTo="{!SaveDraftXml}" value="" />
	    </apex:actionFunction>
		
		<textarea id="xmlInput" />
		
		<input type="button" value="Save" onclick="save()"/>
	
	</apex:form>
	
</apex:page>

 When a complex (and fairly large, at 50,000 characters) xml string is pasted into the text box and the button clicked, the actionFunction call takes between 1.5 and 2 minutes (before it even even gets to the Apex method call). If an equivalent size string of all xxxx's is placed in the text box, the same call takes seconds. This suggests there is maybe some sort of parsing of the xml along the way.... has anyone experienced the same issue, have more information on this or ideally have a good work around? As this is causing us quite some grief.

 

If anyone wants an example xml string to replicate this, please ask, I can supply one.

 

Any response, information, help or sympathy on this one would be very much appreciated....

 

btw: we haven't had any such issues using javascript remoting but due to the maximum request size limitation we can't use it in this case.

colemabcolemab

This is a duplicate post, please my response in your orignal thread.