通过 Flash Builder 4 实现 Flex;连接到动态 XML 源:“响应不是有效的 XML 或 JSON 字符串”
我正在学习如何将 Flex 与 Adobe Flash Builder 4 独立使用。我正在阅读 David Gassner 编写的 Adobe Flash Build 4 Bible。这促使我创建自己的微观问题来尝试解决。
我正在尝试连接到由以下 aspx 页面创建的 dynamix XML feed: generate_xml.aspx
当我通过“数据/服务”面板创建数据连接时,我可以在 XML 和 HTTP 之间进行选择。我认为因为generate_xml.aspx 必须首先生成XML 文件,所以我应该使用HTTP 服务而不是XML。 HTTP 服务提供 GET,这似乎是我想要的东西。
然而,我真的很难做到这一点。我不断收到:
“响应不是有效的 XML 或 JSON 字符串”
当我保存此页面创建的实际 STATIC 生成的 XML 文件并手动连接 XML 服务时,该文件运行良好。因此我知道我的 XML 代码格式正确并且不包含 JavaScript 的其他 HTML。
我认为出现问题是因为页面本身是 .aspx,但我无法弄清楚如何成功地要求 Flex 请求该页面的输出,而不是页面本身。
I am learning how to use Flex with Adobe Flash Builder 4 standalone. I am working my through the Adobe Flash Build 4 Bible by David Gassner. This has led me to create my own micro problems to try and solve.
I am trying to connect to a dynamix XML feed created by the following aspx page:
generate_xml.aspx
When I create the data connection through the Data/Service panel, I can pick between XML and HTTP. I figured because the generate_xml.aspx has to generate the XML file first, I should use the HTTP service as opposed to the XML. The HTTP service offers GET, which seems to be the kinda thing I want.
However, I am really struggling to do this. I keep getting:
"The response is not a valid XML or a JSON string"
The actual STATIC generated XML file that is created by this page works perfectly when I save it and manually connect with the XML service. Therefore I know my XML code is properly formatted and contains no other HTML of JavaScript.
I figure my problem occurs because the page itself is .aspx, but I cannot work out how to successfully ask Flex to request the output of this page, rather than the page itself.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过更改专用服务器“处理”生成文件的方式解决了这个问题。基本上,Flex 看到的是创建 XML 的 asp.net 页面,而不是生成的 XML。通过更改专用服务器上 iis 配置上的处理程序,我可以欺骗 Flex 将其纯粹解析为 XML 文件。
I resolved this issue by changing the way my dedicated server 'handles' the generated file. Basically Flex was seeing the asp.net page that creates the XML and not the generated XML. By changing the handler on the iis configuration on my dedicated server, I could trick Flex into parsing it purely as an XML file.