Asp.Net MVC和Web服务 [英] Asp.Net MVC and Web Services

查看:89
本文介绍了Asp.Net MVC和Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个现有的Asp.Net MVC网站,我也想从同一个域提供的Web服务。

I have an existing Asp.Net MVC Website and I would also like to provide a Web Service from the same domain.

什么是接近这个之情况创建Web服务的最佳方式?

What is the best way to approach creating a web service in this scenerio?

我加入到这个项目中还是...?

Do I add to this project or...?

推荐答案

您应该能够直接添加一个WebService的文件到MVC项目。
右键单击解决方案,并选择添加新项,然后选择Web类别和ATT列表的底部,应该有Web服务。

You should be able to add an WebService file directly to the MVC project. Right click on solution and select add new item, then select the web category and att the bottom of the list there should be Web Service.

请记住检查的路由不吃起来调用web服务。

Just remember to check that the routes does not eat up the call to the webservice.

这样的Web服务可以访问相同的模型类的MVC应用程序。

That way the webservice can get access to the same model classes as the MVC application.

这篇关于Asp.Net MVC和Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆