我正在做一个 ajax 帖子,通过 AJAX 将用户的评论提交给远程 CFC。代码一直都可以正常工作,除非注释字符长度达到大约 7300 个字符。然后,就好像 CFC 什么都不做。
在 Firebug 中,我可以看到对于提交的所有评论 < 7300 个字符,响应返回就好了,但是,对于 > 7300 个字符的数据包,此响应是空白的。
所以,很自然地,我在被调用的远程 cfc 方法中添加了一些简单的日志记录。我删除了所有代码,只是做了一些简单的日志记录,甚至没有执行,因为没有记录任何内容。从评论中删除几个字符并重新提交,它会再次起作用。
所以有些东西让我相信,对于发送的大于 7300 个字符的大数据包,CFC 以某种方式拒绝了请求。这可能吗?可能是什么原因造成的?我查看了管理员,但没有看到任何与此相关的设置。
任何帮助,将不胜感激。谢谢。
下面是 CFC 的代码。我发现提交任何 jquery / ajax javascript 代码是不必要的,因为它确实有效,而且这个问题与请求的大小有关,但如果你觉得它可能有帮助,请告诉我,我也会发布它。
CFC 被称为:
<cffunction name="callFunction" access="remote" returntype="any" output="false">
<cfargument name="cfc" type="string" required="yes" hint="The path or alias for the cfc to call" />
<cfargument name="functionName" type="string" required="yes" hint="The function name within the requested cfc to call" />
<cfargument name="returnFormat" type="string" default="json" hint="The format of the repsonse: xml, json, wsdl, etc." />
<cfargument name="jsonData" type="string" required="false" />
<cfargument name="isLoginRequired" type="boolean" default="true" />
<cfset application.Security.LogItem("CFC: #arguments.cfc#", false, false) />
<cfset application.Security.LogItem(arguments.jsonData, false, false) />
<cfset var sResponse = this.Utilities.GetNewResponse() />
<cfreturn sResponse /></cffunction>