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.

    评论

报告相同问题?

悬赏问题

  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮