我如何将xml格式的数据从flex传递到python
我想从flex将xml格式的数据传递到python中。我知道如何从flex传递,但我的问题是如何在python中获取传递的数据,然后将数据插入到mysql中。而且我想检索mysql数据到python(cgi),python应该将所有数据转换为xml格式,并将所有数据传递给flex.. 提前致谢.....
i want to pass xml format data into python from flex.i know how to pass from flex but my question is how can i get the passed data in python and then the data should be inserted into mysql.and aslo i want to retrieve the mysql data to the python(cgi),the python should convert all the data into xml format,and pass all the data to the flex..
Thank's in advance.....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅 http://www.artima.com/weblogs/viewpost.jsp?thread =208528有关更多详细信息,这里是我认为您正在寻找的内容的简要概述。
SimpleXMLRPCServer 库允许您轻松创建服务器。以下是您可以创建的最简单的服务器,它提供了两种操作字符串的服务:
一旦您与服务器建立连接,该服务器就像本地对象一样。您可以像调用该对象的普通方法一样调用服务器的方法。
这就是您所希望的最干净的 RPC 实现(并且存在其他 Python RPC 库;例如,CORBA 客户端)。但这都是基于文本的;当尝试创建具有漂亮 GUI 的精美应用程序时,并不是很令人满意。我们想要的是世界上最好的——Python(或你最喜欢的语言)在幕后完成繁重的工作,而 Flex 创造用户体验。
要使用该库,请下载它并将其解压到某个位置。该软件包包含所有源代码和编译后的 as3-rpclib.swc 库 - .swc 扩展名表示存档文件,并且可以提取该库的各个部分并将其合并到最终的 .swf 中。要将库包含在您的项目中,您必须通过转至“项目|属性”并选择“来告诉 Flexbuilder(您可以获得免费试用版或仅使用免费的命令行工具,并添加 Apollo 部分)该库所在的位置” Apollo 构建路径”,然后选择“库路径”选项卡并按“添加 SWC...”按钮。接下来,将命名空间 ak33m 添加到项目中,如下面的代码所示,然后就可以创建 XMLRPCObject。
注意:我在这里使用 Apollo 的唯一原因是我正在考虑具有漂亮 UI 的桌面应用程序。您可以轻松地将其设为 Flex 应用程序。
这是整个 Apollo 应用程序作为单个 MXML 文件,我将详细解释:
See http://www.artima.com/weblogs/viewpost.jsp?thread=208528 for more details, here is a breif overview of what I think you are looking for.
The SimpleXMLRPCServer library allows you to easily create a server. Here's about the simplest server you can create, which provides two services to manipulate strings:
Once you make a connection to the server, that server acts like a local object. You call the server's methods just like they're ordinary methods of that object.
This is about as clean an RPC implementation as you can hope for (and other Python RPC libraries exist; for example, CORBA clients). But it's all text based; not very satisfying when trying to create polished applications with nice GUIs. What we'd like is the best of all worlds -- Python (or your favorite language) doing the heavy lifting under the covers, and Flex creating the user experience.
To use the library, download it and unpack it somewhere. The package includes all the source code and the compiled as3-rpclib.swc library -- the .swc extension indicates an archive file, and pieces of this library can be pulled out and incorporated into your final .swf. To include the library in your project, you must tell Flexbuilder (you can get a free trial or just use the free command-line tools, and add on the Apollo portion) where the library is located by going to Project|Properties and selecting "Apollo Build Path," then choosing the "Library path" tab and pressing the "Add SWC..." button. Next, you add the namespace ak33m to your project as seen in the code below, and you're ready to create an XMLRPCObject.
Note: the only reason I used Apollo here was that I was thinking in terms of desktop applications with nice UIs. You can just as easily make it a Flex app.
Here's the entire Apollo application as a single MXML file, which I'll explain in detail: