WCF服务的前端

我必须做出一个相当大的设计决定,并希望向有经验的人提出一些建议。</ p >

我正在使用WCF开发SOA服务(包括登录+用户帐户管理,客户数据库,公司不同产品线的演示)。</ p>

我现在 我必须决定使用哪种前端技术来生成用户可以在浏览器中查看的HTML。 </ p>

合乎逻辑的答案是:ASP.Net。 但是,我想知道其他选择。 我正在考虑使用PHP服务(因为我想学习这种语言)。 我可以想到这个场景:
-最终用户通过HTTP访问PHP服务,PHP服务通过SOAP对WCF服务执行一些业务逻辑调用,然后将结果返回给用户。</ p>

这至少会产生用户会话管理必须位于PHP服务一边的问题,因为WCF服务只能由PHP服务调用。</ p>

所以, 是否有更简单的方法在我的WCF服务面前获得一些(动态)HTML表示层(忽略ASP.net,最好使用PHP)? </ p>
</ div>

展开原文

原文

I have to make a rather big design decision and would like to ask for some advices from experienced people.

I am developing a SOA service using WCF (includes Login + user account management, customer databases, presentation of different product lines of the company).

I now have to decide which front-end technology I am going to use in order to generate the HTML that the users can view in their browsers.

The logical answer would be: ASP.Net. However, I would like to know about other options. I am thinking of using a PHP service (since I would like to learn this language). I can think of this scenario: - The end user accesses the PHP service via HTTP and the PHP service performs some business-logic calls via SOAP to the WCF service and then returns the results to the user.

This creates at least the problem that the user session management has to be on side of the PHP service because the WCF services are only called by the PHP service.

So, is there an easier way to get some (dynamic) HTML presentation layer in front of my WCF service (ignoring ASP.net and preferably using PHP)?

1个回答



对于我6个月前参与的一个小项目,我们的情况非常相似。 我们有一个网站和3个移动应用程序,与Windows Azure中托管的WCF服务进行了对话。 移动应用程序开发人员与WCF服务没有任何问题,但该网站是一个不同的野兽。</ p>

我们使用ASP.Net前端,但由于它是作为一个主机托管 Azure内部的不同项目,它必须通过HTTP访问WCF服务。</ p>

我认为一旦你确定这是你想要设置它的方式,你是否选择了ASP.Net 或者PHP不再那么重要了(除了托管成本等)。 基本上,您的前端成为一个瘦代理,将请求路由到WCF服务并返回到浏览器。 您可以使用PHP和ASP.Net轻松完成此任务。</ p>

现在回顾一下该项目,我认为在同一个项目中托管WCF服务和前端, 但使用两个单独的Web角色。 这完全消除了让您的前端进行HTTP调用所涉及的延迟。 此外,您的前端和WCF服务可以使用相同的类库来访问业务逻辑。 理想情况下,您的前端和WCF服务都将成为瘦包装器,它们都与所有业务逻辑的相同类库接口。</ p>

这是我能看到HTML的唯一方法 表示层变得更容易。 如果您的前端位于elswehere并通过HTTP与您的业务逻辑接口,那么PHP和ASP.Net同样适合该任务。 会话管理; 这很容易,因为您表示用户帐户管理和登录全部由WCF服务处理。 那么你的PHP或ASP.Net会话可能只保存服务给你的会话令牌,服务负责会话超时等。</ p>
</ div>

展开原文

原文

For a small project I was part of some 6 months ago, we had a very similar situation. We had a website and 3 mobile apps that talked with a WCF service hosted in Windows Azure. The mobile app developers had no issues talking to the WCF service, but the website was a different beast.

We went with an ASP.Net front-end, but since it was hosted as a different project inside Azure, it had to access the WCF service via HTTP.

I think once you have decided that this is the way you want to set it up, whether you pick ASP.Net or PHP isn't really of much importance anymore (apart from hosting costs etc). Essentially your front-end becomes a thin proxy that routes requests to the WCF service and back to the browser. You can do this easily with both PHP and ASP.Net.

Looking back at the project now, I would have argued for hosting the WCF service and the front-end in the same project, but using two separate Web roles. That completely eliminates the latency involved with having your front-end making HTTP calls. Also, your front-end and WCF service can use the same class library to access the business logic. Ideally, both your front-end and WCF service would then become thin wrappers that both interface with the same class library for all the business logic.

That is the only way I can see the HTML presentation layer becoming easier. If your front-end sits elswehere and interfaces with your business logic via HTTP, then both PHP and ASP.Net are equally suited to the task. As far as session management goes; that would be very easy since you indicated that user account management and login is all handled by the WCF service. Your PHP or ASP.Net session would then probably only hold the session token that the service has given you, with the service being responsible for session timeout etc.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐