2015-03-31 74 views
3

我使用CFM2WDDX转换在CF11的数组,但我收到此错误:CFML2WDDX错误的ColdFusion 11

coldfusion.tagext.validation.WddxValidator$InvalidWddxPacketException: Invalid WDDX packet..

我使用这个代码在这里:

getFileList.cfm

<cfsetting enablecfoutputonly="Yes"> 
<cfset thisdir = ExpandPath(".\")> 
<cfdirectory directory="#thisdir#" action="LIST" name="imagefiles" recurse="No"> 
<cfscript> 
// get .gif|.jpg|.png files from the cfdirectory query... 
numRows = imagefiles.recordcount; 
imageFileArray = ArrayNew(1); 
for (row = 1; row LTE numRows; row++) { 
    if (refindnocase("(.gif|.jpg|.png)",imagefiles.name[row]) neq 0) { 
     ArrayAppend(imageFileArray, imagefiles.name[row]); 
    }  
} 
</cfscript> 
<cfwddx action="cfml2wddx" input=#imageFileArray# output="wddxText"> 
<cfoutput>#wddxText#</cfoutput> 

正如你所看到的代码创建一个图像名称的数组,然后我通过cfhttp访问做我所需要的用它。我有一个相同的确切的代码与CF9服务器上的相同的确切目录内容和正常工作,但在CF11我得到格式错误。莫名其妙地改变了CF11的功能?

这是我使用访问上面的代码的代码:

<cfhttp url="http://example.com/images/ClientLogos/getFileList.cfm" method="GET" timeout="10" throwonerror="Yes"> 
    <cfwddx action="WDDX2CFML" input="#trim(cfhttp.filecontent)#" output="imageArray" validate="true"> 
    <cfreturn imageArray> 

getFileList.cfm与图像相同的目录,因此执行本地服务器在正在从呼吁。 (这就是为什么我认为CF11可能是问题)从CF9输出的

部分:

enter image description here

而且从CF11的输出部分:

enter image description here

CFHTTP。来自CF 11的标题:

HTTP/1.1 200 OK Content-Type: text/html;charset=UTF-8 Server: Microsoft-IIS/8.0 X-Powered-By: ASP.NET Access-Control-Allow-Origin: * Date: Tue, 31 Mar 2015 18:50:35 GMT Connection: close Content-Length: 10807 

CFHTTP.Header从CF 9:

HTTP/1.1 200 OK Content-Type: text/html; charset=UTF-8 Vary: Accept-Encoding Server: Microsoft-IIS/7.5 X-Powered-By: ASP.NET Date: Tue, 31 Mar 2015 18:51:20 GMT Connection: close 

+0

https://bugbase.adobe.com/ – Henry 2015-03-31 17:41:34

+0

@Henry你是说我应该添加到bugbase或搜索它从类似的问题? – Geo 2015-03-31 18:04:34

+0

如果您只是浏览到您的'getFileList.cfm'页面,它是否显示WDDX格式的数据?我只是在本地的CF9和CF11服务器上做了一个快速测试。两者都按预期工作。但是我没有执行'cfhttp'部分。我刚刚浏览了我的测试页。 – 2015-03-31 18:25:31

回答

0

我不知道是什么原因造成这种行为,但我发现了一个中间地带现在。我不是通过cfhttp调用getFileList.cfm,而是直接在我的函数内移动getFileList.cfm中的代码,并且一切正常。开始使用该文件的原因是允许我在不需要/不再使用的其他服务器上访问外部映像回购。无论哪种方式,这可能实际上是一个CF11的bug,所以我们将在未来看到...

+0

生成的WDDX字符串有什么区别? – 2015-03-31 20:57:51

+0

@JamesAMohler根本没有! – Geo 2015-04-01 00:17:29

+0

(编辑)@Geo - (同意删除cfhttp更有意义,因为它不再需要,但出于好奇......)你检查它的性格和*一切*是相同的,包括空白? – Leigh 2015-04-01 19:35:31