dpruwm6206 2012-12-02 09:35
浏览 58

WCF服务的前端

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条回答

  • dqrmkdu25623 2013-02-11 15:02
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置