柔性和网络服务

发布于 2024-10-15 12:12:10 字数 662 浏览 6 评论 0原文

我们有一个 Flex 应用程序,它严重依赖于通过 asp.net 提供的数据驱动内容。目前,大部分数据是通过 asp.net 对象提供的,然后对这些对象进行 XML 序列化并通过简单的 ASHX 处理程序发送。然后通过单例类中的 e4x 对其进行解析,以填充其自身或子类数组,然后这些子类可供应用程序的其余部分使用,而无需进行额外的数据调用。

这可行,但这是最好的方法吗?我读过很多讨论这个主题的文章,但找不到任何共识。

我应该考虑将它们转换为 Web 服务吗?如果是这样,我应该如何管理绑定、通过 Flex 自动导入它们或构建我自己的绑定?有什么优点和缺点。这个决定的一个重要因素是速度,最低延迟和最高吞吐量至关重要。

作为一个单独的问题,我们的应用程序并不位于域的根部,并且在本地开发时对我们的开发服务器进行数据调用。因此,我们将 flash 变量添加到应用程序以指定 appRoot,然后根据需要将其附加到服务 url。

MyService.url = GeneralData.ApplicationRootUrl + "Services/foobar.ashx";

这是最好的方法吗?我已经发现了 rootURL 属性,我应该使用它吗?它在这种情况下如何工作?如果我要将服务转换为 Web 服务,我将如何实现相同的功能以允许本地开发?

非常感谢

We have a Flex application which relies heavily on data driven content supplied via asp.net. Currently the majority of this data is provided via asp.net objects which are then XML serialised and sent via a simple ASHX handler. This is then parsed via e4x in singleton classes to populate either its self or arrays of sub classes which are then available to the rest of the application without making additional data calls.

This works but is it the best way? I've read quite a few articles discussing the subject but couldn't really find any consensus.

Should I look into converting these to Web Services? If so, how should I manage the bindings, automatically import them via Flex or build my own? What are the pro's and con's. An important factor in this decision is speed, lowest latency and highest throughput is essential

As a separate matter our application doesn't sit at the root of the domain, and when in local development makes data calls to our development servers. As a result we add flash vars to the application to specify the appRoot which is then appended to the service url as necessary.

MyService.url = GeneralData.ApplicationRootUrl + "Services/foobar.ashx";

Is this the best way? I have since discovered the rootURL property, should I be using this, how does it work in this context? If I were to convert the services to web services how would I go about implementing the same functionality to allow local development?

Many thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

请爱~陌生人 2024-10-22 12:12:10

这可行,但这是最好的方法吗?

根据您的情况,最佳是非常主观的。如果可能的话,我建议您使用 AMF 网关。这样,您的对象可以立即从服务器端对象(.NET 类)转换为客户端对象(AS3 类)。这可以节省大量时间,因为您不必在后端手动创建 XML,也不必在前端手动处理它。此外,AMF 的二进制格式将提供比 XML 或 SOAP WebService 小得多的数据包。

对于 .NET AMF 选项,我会研究 WebORBFlourineFX

This works but is it the best way?

Best is very subjective based on your situation. If at all possible, I would recommend you use an AMF gateway. That way your objects can immediately convert from server side objects (.NET Classes) to client side objects (AS3 classes). This is a big time savings because you don't have to manually create your XML on the back end, nor manually process it in the front end. Also the binary format of AMF is going to give much smaller packets than XML or a SOAP WebService would.

For .NET AMF options, I'd look into WebORB or FlourineFX

荒芜了季节 2024-10-22 12:12:10

Flex 应用程序始终在浏览器中加载,您可以使用相对 URL,以便您的应用程序将从加载位置连接到同一服务器。

MyService.url = "/Services/foobar.ashx";

“/”肯定会附加主机的来源。连接到加载闪存的同一主机始终是一个好习惯。

其次,SOAP Web 服务使用 xml 序列化,因此如果您使用处理程序进行 e4x 序列化或使用 Flash Builder 的 SOAP Web 服务生成器,速度将几乎相同。 SOAP Web 服务肯定会慢一点,但差异将在微秒到毫秒之间。

然而,使用 Web 服务,您的开发速度将会提高,因为您不必创建代理类。

Flex Application is always loaded in browser, and you can use relative URL, so that your application will connect to same server from where it is loaded.

MyService.url = "/Services/foobar.ashx";

"/" will certainly append host where it came from. And it is always good practice to connect to same host where the flash is loaded from.

Secondly, SOAP web services use xml serialization, so if you use your handler to do e4x serialization or you use SOAP web service generator of Flash Builder, speed will be almost same. SOAP web service will certainly be little slower, but the difference will be in micro seconds to milli seconds.

However, with Web services, your development will speed improve as you will not have to create proxy classes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文