Can an asp.net mvc application also have a web service?

前端 未结 6 1422
你的背包
你的背包 2021-02-09 06:42

I have an asp.net mvc application and now I need to add a web service to go along with it. What is the best solution for this? Just create a new web service project and add it

6条回答
  •  悲&欢浪女
    2021-02-09 07:23

    Web service could mean a soap based web service or a RESTful web service. I can't think of any reason why you would not be able to simply add an asmx file to your project and be in business. That is the soap based route. If you want to be really cool though you can simple return xml from a controller action and implement a RESTful solution right over the MVC framework.

提交回复
热议问题