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 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题