English 中文(简体)
如何以 anzure、 wcf、 asp. net 和 json 创建应用程序
原标题:How to create application with azure, wcf, asp.net and json

I am fairly new to azure, wcf, asp.net and json. I have experience with WPF.

我想在Azure云上建立服务。

Authentication/ASP.net/Session: When an application, for example a WPF application, WP app/whatever, wishes to use the service, it has to authenticate - and be authenticated for the rest of the session. The authentication is done with windows live id (I guess this is where asp.net comes in?).

<强势>WCF: 我想用WCF服务来揭露方法。 如何从世界“ 隐藏” WCF服务, 直到用户登录?

Json: 因为我想用这个来(希望将来)WPF应用程序、WP应用程序、机器人应用程序、iphone应用程序等。 我想用Json。

" 强力 " 阿苏尔: " 强力 " 我想主持我所有的 " 暴风雨 " 。

首先,我想创建一个Wpf 应用程序,其内容如下:

  1. The user logs in/registeres
  2. The asp.net/wcf authenticates and starts a session. (I don t know how to authenticate)
  3. The user writes a string and passes this with json/http to the WCF service (http will do for now, unless https is easier when authenticating anyways)
  4. The WCF services returns "Hello from azure: " + the string the user wrote

我非常愿意听取各种建议和想法。

我需要的帮助是教义、走道、样本、指导等等, 才能让我开始这个项目。 我看过一些教义、 样本等等, 但总是缺少部件 。

有人能指引我正确的方向吗? 提供一些建议?

最佳回答

以下是我对你如何开始的看法:

Authentication/ASP.net/Session: - With Azure you can use OpenID based authentication using ACS so look for using ACS on this regard. For ASP.NET session specific requirement you can use Windows Azure Cache which is best and cost effective for such scenarios.

<强势>WCF :好的情景,你可以访问 ASP.NET(和/或MVCx)网站,然后使用 OpenID 认证用户,一旦认证,你可以让他们访问WCF的终点或任何您想访问的功能, 将其设置在您的 < a href=> https://www.windowsazure.com/en-us/ develop/net/how-to-guides/ access-control/" rel="nofol" 配置 < ACS 配置 。

JSON :您可以使用 < a href="http://pozitive.net/2011/02/11/json-asp-net-mvc-and-jquery-work-with-untyped-json- made-sai/" rel=“nofollow”>JSON与 ASP.NET 。您可以使用jQuery来控制UI, 然后通过 AJAX/JSON调用命令。 它还允许您用新内容更新页面, 而不必刷新页面。 使用它的方法可能更多。

Windows Azure: :现在确定你对Windows Azure 了解多少,但你应该对SDK、部署过程等有基本知识。

最后,你们可以尝试如下:

  1. The user logs in/registeres > ASP.NET MVC Web Role
  2. The asp.net/wcf authenticates and starts a session. >> Use ACS with OpenID
  3. The user writes a string and passes this with json/http to the WCF service > Have an interface for string to be entered at web page and pass it to WCF over HTTP or HTTPS depend on how your bindings are)
  4. The WCF services returns "Hello from azure: " + the string the user wrote

希望这能帮上忙!

问题回答

我建议您先读一些 < a href=> http://www.windowsazure. com/ en- us/ development/ net/ net/tuatives/ web- app- with- sql- azure/" rel=" nofol" > Windows Azure 教程 < / a>。 主的.NET Web App教程( 链接) 显示您如何处理 1 & amp; 2 和 < a href=" http://www. windowsazure. com/ en- us/ Develop/ net/tutorings/ multitier- application/" rel="nofolpol" > > multi- Tier supplitement 涵盖 3 & amp; 4 相当不错( 虽然我相信使用Json) 。 一旦您了解这一点, 适应您的需要应该是容易的。

有关会话状态 : 正如我在 < a href=> https://stackoverflow.com/ a/583382/ 272109> > > this StackOverplow 回答中所提到的, 您有多个选项 。 @ Avkash 指出一个选项, 要使用 Window Azure Cache 。 您需要知道, 缓存是一种多重租赁服务, 其缓存消耗有特定的小时限制 。 根据用户需求/ 负荷, 您可以超过小时配额, 并且无法获取缓存, 直至以下时间( 这意味着您需要计划一个比最初需要的更大的缓存) 。 更多关于缓存和相关配额的信息, < href="http://msdn. microft. com/ en- us/library/ windowsazure/hh697522. aspx" rel= " nofoln noreferrr" > a/ a > 。 请注意, 128MB 缓存的定价始于 45。

您也可以通过 SQL Azure 管理会话状态 。 这没有交易配额, 100MB 的价格为 4. 99 美元 。 见 Nate Totten s < a href="http://blog. entitten.com/2011/ 08/03/ windowows- azure- tools-1-4- released/" rel=" no follown norefererr">blog post 关于使用 SQL Azure 进行会话状态的公告 。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签