多平台应用程序:ashx 还是 Web 服务?
我正在寻找创建一个轻量级、大流量的数据库站点。 它将是asp.net 中标准的三层架构。 该网站的一部分是基于网络的,但大多数功能最好也可以在移动设备上使用。
话虽这么说,我知道 Web 服务是这个问题的经典答案,因为我可以从许多平台访问 Web 服务。 不过,我也知道 ashx 文件是最轻量级的。 有没有办法从非网络平台访问 ashx 文件? 如果是这样,与执行相同操作的 Web 服务相比如何?
一个很好的例子:调用 Web 服务或 ashx 文件进行身份验证的登录页面。
谢谢!
Eric
[编辑] 我正在思考 iphone/android/pre 类型的移动应用程序。
I am looking to create a lightweight, heavy traffic, db site. It will be standard 3 tiered architecture in asp.net. Part of this site is web-based, but most of the functions will ideally be available on mobile devices, also.
That being said, I know that web services is the classic answer for this, since I can access a web service from many platforms. However, I also know that ashx files are the most light-weight. Is there a way to access ashx files from non-web platforms? and if so, how would this compare to a web service to do the same thing.
a good example: a login page that calls either a web service or ashx file to authenticate.
Thanks!
Eric
[EDIT] I was thinking along the lines of iphone/android/pre type of mobile apps.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将如何在移动设备上显示? 您说过“基于网络”和“移动设备”,但它们可以是同一件事。 例如,通过 控制适配器
如果你没有。 它应该有助于您希望从应用程序中获得分层设计和性能。
.ASHX 文件将有效地交付您所需的任何内容类型。 这是它的关键优势之一。 所以你的问题的答案是肯定的,它可以用于通过 SOAP 或其他 HTTP 传输方案传递到非 Web 平台。 这比使用网络服务要复杂得多。
通过您的登录示例,我看到的主要好处是您的 ASHX 文件可以使用多种传输方案,而不仅仅是 SOAP。 例如,您可以使用重量较轻的 REST。
How will you display on the mobile devices? You've said "web-based" and "mobile devices" but these can be the same thing. E.g. Through Control Adapters
You should also look at ASP.Net MVC if you haven't. It should help with the tiered design and performance that you are looking to get out of your application.
An .ASHX file will efficiently deliver any content type that you require. That is one of it's key strengths. So the answer to your question is yes, it can be used to deliver to non-web platforms via SOAP or other HTTP transport schemes. This would be a lot more involved than using web services.
With your login example, then main benefit that I see is that your ASHX file can use multiple transport schemes, not just SOAP. So you can use the lighter weight REST for instance.